Don't persist filters to localStorage

merge-requests/3337/head
Alex Gleason 2025-03-13 00:39:48 -05:00
rodzic 4c765990f6
commit 8ead53a2c9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 0 dodań i 22 usunięć

Wyświetl plik

@ -60,9 +60,6 @@ const ExploreFilter = () => {
useEffect(
() => {
const value = formatFilters(filters);
localStorage.setItem('soapbox:explore:filters', JSON.stringify(filters));
debouncedSearch(value);
return () => {

Wyświetl plik

@ -195,7 +195,6 @@ const CreateFilter = () => {
const handleReset = () => {
dispatch(resetFilters());
localStorage.removeItem('soapbox:explore:filters');
};
const handleClearValue = () => {

Wyświetl plik

@ -7,26 +7,8 @@ import appReducer from './reducers/index.ts';
import type { AnyAction } from 'redux';
const loadState = (pathname: string) => {
try {
if (pathname !== '/explore') return undefined;
const savedState = localStorage.getItem('soapbox:explore:filters');
return savedState ? JSON.parse(savedState) : undefined;
} catch (error) {
console.error('Failed to load state:', error);
return undefined;
}
};
const preloadedState = (() => {
const storedFilter = loadState(window.location.pathname);
return storedFilter ? { search_filter: storedFilter } : {};
})();
export const store = configureStore({
reducer: appReducer,
preloadedState,
middleware: () => new Tuple(
thunk,
errorsMiddleware(),