mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
remove all instances of first as it can cause an error if it's never triggered
This commit is contained in:
6
src/app/core/cache/object-cache.service.ts
vendored
6
src/app/core/cache/object-cache.service.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { combineLatest as observableCombineLatest, Observable } from 'rxjs';
|
||||
|
||||
import { distinctUntilChanged, filter, first, map, mergeMap, } from 'rxjs/operators';
|
||||
import { distinctUntilChanged, filter, first, map, mergeMap, take, } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
import { IndexName } from '../index/index.reducer';
|
||||
@@ -165,7 +165,7 @@ export class ObjectCacheService {
|
||||
|
||||
this.store.pipe(
|
||||
select(selfLinkFromUuidSelector(uuid)),
|
||||
first()
|
||||
take(1)
|
||||
).subscribe((selfLink: string) => result = this.hasBySelfLink(selfLink));
|
||||
|
||||
return result;
|
||||
@@ -184,7 +184,7 @@ export class ObjectCacheService {
|
||||
let result = false;
|
||||
|
||||
this.store.pipe(select(entryFromSelfLinkSelector(selfLink)),
|
||||
first()
|
||||
take(1)
|
||||
).subscribe((entry: ObjectCacheEntry) => result = this.isValid(entry));
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user