feat(catalog): add filter to hide text-only threads, turned on by default

This commit is contained in:
Tom (plebeius.eth)
2024-06-14 21:56:23 +02:00
parent b984f5f48b
commit ce93915919
4 changed files with 50 additions and 7 deletions
+16
View File
@@ -0,0 +1,16 @@
import { create } from 'zustand';
interface CatalogFiltersStore {
showTextOnlyThreads: boolean;
setShowTextOnlyThreads: (value: boolean) => void;
}
const useCatalogFiltersStore = create<CatalogFiltersStore>((set) => ({
showTextOnlyThreads: localStorage.getItem('showTextOnlyThreads') === 'true' ? true : false,
setShowTextOnlyThreads: (value: boolean) => {
set({ showTextOnlyThreads: value });
localStorage.setItem('showTextOnlyThreads', value.toString());
},
}));
export default useCatalogFiltersStore;