mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +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';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { debounceTime, take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { ListableObject } from '../listable-object.model';
|
import { ListableObject } from '../listable-object.model';
|
||||||
import { ViewMode } from '../../../../core/shared/view-mode.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) {
|
if ((this.compRef.instance as any).reloadedObject) {
|
||||||
(this.compRef.instance as any).reloadedObject.pipe(
|
(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)
|
take(1)
|
||||||
).subscribe((reloadedObject: DSpaceObject) => {
|
).subscribe((reloadedObject: DSpaceObject) => {
|
||||||
if (reloadedObject) {
|
if (reloadedObject) {
|
||||||
|
@@ -10,7 +10,7 @@ import {
|
|||||||
Subject,
|
Subject,
|
||||||
Subscription
|
Subscription
|
||||||
} from 'rxjs';
|
} 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 { RemoteDataBuildService } from '../../../../../core/cache/builders/remote-data-build.service';
|
||||||
import { PaginatedList } from '../../../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../../../core/data/paginated-list.model';
|
||||||
@@ -120,6 +120,8 @@ export class SearchFacetFilterComponent implements OnInit, OnDestroy {
|
|||||||
this.searchOptions$.subscribe(() => this.updateFilterValueList()),
|
this.searchOptions$.subscribe(() => this.updateFilterValueList()),
|
||||||
this.refreshFilters.asObservable().pipe(
|
this.refreshFilters.asObservable().pipe(
|
||||||
filter((toRefresh: boolean) => toRefresh),
|
filter((toRefresh: boolean) => toRefresh),
|
||||||
|
// NOTE This is a workaround, otherwise retrieving filter values returns tha old cached response
|
||||||
|
debounceTime((100)),
|
||||||
mergeMap(() => this.retrieveFilterValues(false))
|
mergeMap(() => this.retrieveFilterValues(false))
|
||||||
).subscribe()
|
).subscribe()
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user