From 791a3572dae4cbfd99cc8f8ed77a4b3cfd73c9ee Mon Sep 17 00:00:00 2001 From: till_schuetze Date: Tue, 19 Nov 2024 09:18:57 +0100 Subject: [PATCH] Reset favoritesOnly and fix display of heatmap --- .../src/lib/state/asset-search/asset-search.effects.ts | 5 +++-- .../src/lib/state/asset-search/asset-search.selector.ts | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/asset-viewer/src/lib/state/asset-search/asset-search.effects.ts b/libs/asset-viewer/src/lib/state/asset-search/asset-search.effects.ts index 0a4be95e..f7a37778 100644 --- a/libs/asset-viewer/src/lib/state/asset-search/asset-search.effects.ts +++ b/libs/asset-viewer/src/lib/state/asset-search/asset-search.effects.ts @@ -79,7 +79,8 @@ export class AssetSearchEffects { return !deepEqual(params.query, storeQuery) || params.assetId != storeDetail?.assetId; }), map(([params, storeQuery, storeDetail, isMostRecentPage]) => { - const hasNoQueryParams = Object.values(params.query).every((v) => v == null || v == false); + const { favoritesOnly, ...query } = params.query; + const hasNoQueryParams = Object.values(query).every((v) => v == null); const hasQueryOrAssetIdInStore = !Object.values(storeQuery).every((v) => v == null || v == false) || storeDetail; // We only use the values from the store if all of the below are true: @@ -87,7 +88,7 @@ export class AssetSearchEffects { // - There are query or assetId values in the store // - The current page is the most recent page if (hasNoQueryParams && hasQueryOrAssetIdInStore && isMostRecentPage) { - return actions.runCombinedSearch({ query: storeQuery, assetId: storeDetail?.assetId }); + return actions.runCombinedSearch({ query: { ...storeQuery, favoritesOnly }, assetId: storeDetail?.assetId }); } return actions.runCombinedSearch({ query: params.query, assetId: params.assetId }); }) diff --git a/libs/asset-viewer/src/lib/state/asset-search/asset-search.selector.ts b/libs/asset-viewer/src/lib/state/asset-search/asset-search.selector.ts index 62e13b36..03a02c80 100644 --- a/libs/asset-viewer/src/lib/state/asset-search/asset-search.selector.ts +++ b/libs/asset-viewer/src/lib/state/asset-search/asset-search.selector.ts @@ -62,7 +62,8 @@ export const selectStudies = createSelector(assetSearchFeature, (state) => state export const selectHasDefaultFilters = createSelector( assetSearchFeature, - ({ query, currentAsset }) => currentAsset == null && Object.values(query).every((value) => value === undefined) + ({ query, currentAsset }) => + currentAsset == null && Object.values(query).every((value) => value === undefined || value == false) ); export const selectCurrentAssetDetailVM = createSelector(