Skip to content

Commit

Permalink
Merge pull request #872 from InseeFrLab/fix-navigation-invalid
Browse files Browse the repository at this point in the history
fix #865
  • Loading branch information
garronej authored Nov 8, 2024
2 parents 46ebeef + cc6ffa1 commit dd15640
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions web/src/core/usecases/catalog/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ export const thunks = {
})();

const selectedCatalogId =
params.catalogId ??
catalogs.filter(({ isProduction }) => isProduction)[0].id;
params.catalogId !== undefined &&
catalogs.some(({ id }) => id === params.catalogId)
? params.catalogId
: catalogs.filter(({ isProduction }) => isProduction)[0].id;

dispatch(
actions.catalogsFetched({
Expand All @@ -96,7 +98,10 @@ export const thunks = {
})
);

if (params.catalogId === undefined) {
if (
params.catalogId === undefined ||
params.catalogId !== selectedCatalogId
) {
dispatch(actions.defaultCatalogSelected());
}
},
Expand Down

0 comments on commit dd15640

Please sign in to comment.