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(