Skip to content

Commit 8c92364

Browse files
122357: Ensure the request href$ observable aren't triggered multiple times
(cherry picked from commit 3ecdfe4)
1 parent 08bda53 commit 8c92364

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/app/core/data/base/base-data.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* http://www.dspace.org/license/
77
*/
88

9-
import { AsyncSubject, from as observableFrom, Observable, of as observableOf } from 'rxjs';
9+
import { AsyncSubject, from as observableFrom, Observable, of as observableOf, shareReplay } from 'rxjs';
1010
import { map, mergeMap, skipWhile, switchMap, take, tap, toArray } from 'rxjs/operators';
1111
import { hasValue, isNotEmpty, isNotEmptyOperator } from '../../../shared/empty.util';
1212
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
@@ -264,6 +264,7 @@ export class BaseDataService<T extends CacheableObject> implements HALDataServic
264264
isNotEmptyOperator(),
265265
take(1),
266266
map((href: string) => this.buildHrefFromFindOptions(href, {}, [], ...linksToFollow)),
267+
shareReplay(1),
267268
);
268269

269270
const startTime: number = new Date().getTime();
@@ -299,6 +300,7 @@ export class BaseDataService<T extends CacheableObject> implements HALDataServic
299300
isNotEmptyOperator(),
300301
take(1),
301302
map((href: string) => this.buildHrefFromFindOptions(href, options, [], ...linksToFollow)),
303+
shareReplay(1),
302304
);
303305

304306
const startTime: number = new Date().getTime();

0 commit comments

Comments
 (0)