diff --git a/apps/portal/src/utils/questions/useSearchParam.ts b/apps/portal/src/utils/questions/useSearchParam.ts index 25208e6e..b8ae89d8 100644 --- a/apps/portal/src/utils/questions/useSearchParam.ts +++ b/apps/portal/src/utils/questions/useSearchParam.ts @@ -42,8 +42,12 @@ export const useSearchParam = ( // Try to load from local storage const localStorageValue = localStorage.getItem(name); if (localStorageValue !== null) { - const loadedFilters = JSON.parse(localStorageValue); - setParams(loadedFilters); + const loadedFilters = JSON.parse(localStorageValue) as Array; + setParams( + loadedFilters + .map(stringToParam) + .filter((value) => value !== null) as Array, + ); } } setIsInitialized(true);