|
|
@ -42,8 +42,12 @@ export const useSearchParam = <Value = string>(
|
|
|
|
// Try to load from local storage
|
|
|
|
// Try to load from local storage
|
|
|
|
const localStorageValue = localStorage.getItem(name);
|
|
|
|
const localStorageValue = localStorage.getItem(name);
|
|
|
|
if (localStorageValue !== null) {
|
|
|
|
if (localStorageValue !== null) {
|
|
|
|
const loadedFilters = JSON.parse(localStorageValue);
|
|
|
|
const loadedFilters = JSON.parse(localStorageValue) as Array<string>;
|
|
|
|
setParams(loadedFilters);
|
|
|
|
setParams(
|
|
|
|
|
|
|
|
loadedFilters
|
|
|
|
|
|
|
|
.map(stringToParam)
|
|
|
|
|
|
|
|
.filter((value) => value !== null) as Array<Value>,
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setIsInitialized(true);
|
|
|
|
setIsInitialized(true);
|
|
|
|