Merged PR 1287: #3222 Remission Fix Trigger Init Search after Filter gets loaded, relocated u...

#3222 Remission Fix Trigger Init Search after Filter gets loaded, relocated update Cache function
This commit is contained in:
Nino Righi
2022-06-23 15:38:10 +00:00
committed by Lorenz Hilpert
parent 09bed1456e
commit 13d0ac0cbd
2 changed files with 8 additions and 1 deletions

View File

@@ -235,6 +235,13 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
}
this.setFilter(filter);
// Only trigger search with _filterChange$ if no cached data available
// If cached data is available, there is no need to trigger the search
const data = this.getCachedData();
if (data.items?.length === 0) {
this._filterChange$.next(true);
}
},
(err) => {}
)
@@ -306,7 +313,6 @@ export class RemissionListComponentStore extends ComponentStore<RemissionState>
});
this.setSearchResult(results);
this.updateCache();
this.setFetching(false);
this._searchCompleted.next(this.get());
},

View File

@@ -196,6 +196,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
this._onDestroy$.complete();
if (!!this._remissionStore.return) {
this._remissionListStore.cacheCurrentData();
const params = await this._activatedRoute.queryParams.pipe(first()).toPromise();
await this.updateBreadcrumb(params);
}