#1077 Cancel Request on Filter Overlay Close During Search & Reset State

This commit is contained in:
Sebastian
2020-09-24 21:31:42 +02:00
parent a6dd070b4e
commit 395526027b

View File

@@ -32,6 +32,7 @@ import {
withLatestFrom,
startWith,
take,
delay,
} from 'rxjs/operators';
import { SHELF_SCROLL_INDEX } from 'apps/sales/src/app/core/utils/app.constants';
import { ShelfSearchbarComponent } from '../../../components';
@@ -152,8 +153,6 @@ export class ShelfSearchInputComponent
}
let searchQuery = value;
console.log({ isAutocompleteSelected: this.isAutocompleteSelected() });
if (this.isAutocompleteSelected()) {
searchQuery = this.selectedItem$.value.query;
await this.shelfSearchService.search(searchQuery, { bypassValidation });
@@ -295,7 +294,7 @@ export class ShelfSearchInputComponent
private setUpIsLoadingListener() {
this.searchStateFacade.fetching$
.pipe(takeUntil(this.destroy$))
.pipe(takeUntil(this.destroy$), delay(250))
.subscribe((isFetching) => {
this.showAutocompleteResults$.next(!isFetching);
});