Skip to content

Commit ec375fb

Browse files
committed
[CST-6876] move delay in the search-facet-filter.component
1 parent 076fa3e commit ec375fb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/shared/object-collection/shared/listable-object/listable-object-component-loader.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '@angular/core';
1515

1616
import { Subscription } from 'rxjs';
17-
import { debounceTime, take } from 'rxjs/operators';
17+
import { take } from 'rxjs/operators';
1818

1919
import { ListableObject } from '../listable-object.model';
2020
import { ViewMode } from '../../../../core/shared/view-mode.model';
@@ -182,8 +182,6 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
182182

183183
if ((this.compRef.instance as any).reloadedObject) {
184184
(this.compRef.instance as any).reloadedObject.pipe(
185-
// Add delay before emitting event to allow the new object is elaborated on REST side
186-
debounceTime((100)),
187185
take(1)
188186
).subscribe((reloadedObject: DSpaceObject) => {
189187
if (reloadedObject) {

src/app/shared/search/search-filters/search-filter/search-facet-filter/search-facet-filter.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Subject,
1111
Subscription
1212
} from 'rxjs';
13-
import { distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap } from 'rxjs/operators';
13+
import { debounceTime, distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap } from 'rxjs/operators';
1414

1515
import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service';
1616
import { PaginatedList } from '../../../../../core/data/paginated-list.model';
@@ -120,6 +120,8 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
120120
this.searchOptions$.subscribe(() => this.updateFilterValueList()),
121121
this.refreshFilters.asObservable().pipe(
122122
filter((toRefresh: boolean) => toRefresh),
123+
// NOTE This is a workaround, otherwise retrieving filter values returns tha old cached response
124+
debounceTime((100)),
123125
mergeMap(() => this.retrieveFilterValues(false))
124126
).subscribe()
125127
);

0 commit comments

Comments
 (0)