mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[CST-6876] move delay in the search-facet-filter.component
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
import { Subscription } from 'rxjs';
|
||||
import { debounceTime, take } from 'rxjs/operators';
|
||||
import { take } from 'rxjs/operators';
|
||||
|
||||
import { ListableObject } from '../listable-object.model';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
@@ -182,8 +182,6 @@ export class ListableObjectComponentLoaderComponent implements OnInit, OnChanges
|
||||
|
||||
if ((this.compRef.instance as any).reloadedObject) {
|
||||
(this.compRef.instance as any).reloadedObject.pipe(
|
||||
// Add delay before emitting event to allow the new object is elaborated on REST side
|
||||
debounceTime((100)),
|
||||
take(1)
|
||||
).subscribe((reloadedObject: DSpaceObject) => {
|
||||
if (reloadedObject) {
|
||||
|
@@ -10,7 +10,7 @@ import {
|
||||
Subject,
|
||||
Subscription
|
||||
} from 'rxjs';
|
||||
import { distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { debounceTime, distinctUntilChanged, filter, map, mergeMap, switchMap, take, tap } from 'rxjs/operators';
|
||||
|
||||
import { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service';
|
||||
import { PaginatedList } from '../../../../../core/data/paginated-list.model';
|
||||
@@ -120,6 +120,8 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
||||
this.searchOptions$.subscribe(() => this.updateFilterValueList()),
|
||||
this.refreshFilters.asObservable().pipe(
|
||||
filter((toRefresh: boolean) => toRefresh),
|
||||
// NOTE This is a workaround, otherwise retrieving filter values returns tha old cached response
|
||||
debounceTime((100)),
|
||||
mergeMap(() => this.retrieveFilterValues(false))
|
||||
).subscribe()
|
||||
);
|
||||
|
Reference in New Issue
Block a user