Skip to content

Commit

Permalink
Reset favoritesOnly and fix display of heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
TIL-EBP committed Nov 19, 2024
1 parent bcc0c58 commit 791a357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ 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:
// - There are no Url query params
// - 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 });
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 791a357

Please sign in to comment.