Fix get json default

This commit is contained in:
Jon Staab
2025-01-29 08:54:41 -08:00
parent cf64f63878
commit 50f91298e1
+1 -1
View File
@@ -19,7 +19,7 @@ import type {Filter, TrustedEvent} from "@welshman/util"
export const synced = <T>(key: string, defaultValue: T) => {
const init = getJson(key)
const store = writable<T>(init === null ? defaultValue : init)
const store = writable<T>(init === undefined ? defaultValue : init)
store.subscribe((value: T) => setJson(key, value))