From 80c7064666341c2acdac30a1ac91c0c902d794a9 Mon Sep 17 00:00:00 2001 From: beo3000 Date: Fri, 20 Feb 2026 22:34:53 +0100 Subject: [PATCH] ux update --- ka-note/client/src/lib/stores/settings.ts | 42 ----------------------- 1 file changed, 42 deletions(-) delete mode 100644 ka-note/client/src/lib/stores/settings.ts diff --git a/ka-note/client/src/lib/stores/settings.ts b/ka-note/client/src/lib/stores/settings.ts deleted file mode 100644 index 7d9f844..0000000 --- a/ka-note/client/src/lib/stores/settings.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { writable } from 'svelte/store'; - -export interface AppSettings { - showSnoozedTab: boolean; -} - -const STORAGE_KEY = 'ka-note-settings'; - -const defaults: AppSettings = { - showSnoozedTab: true -}; - -function load(): AppSettings { - if (typeof localStorage === 'undefined') return defaults; - try { - const raw = localStorage.getItem(STORAGE_KEY); - return raw ? { ...defaults, ...JSON.parse(raw) } : defaults; - } catch { - return defaults; - } -} - -function createSettingsStore() { - const { subscribe, set, update } = writable(load()); - - subscribe(v => { - if (typeof localStorage !== 'undefined') { - localStorage.setItem(STORAGE_KEY, JSON.stringify(v)); - } - }); - - return { - subscribe, - set, - update, - patch(partial: Partial) { - update(s => ({ ...s, ...partial })); - } - }; -} - -export const settings = createSettingsStore();