forked from coracle/flotilla
Use capacitor preferences package instead of localStorage
This commit is contained in:
committed by
Jon Staab
parent
2672a8f922
commit
c94d314f6d
@@ -1,5 +1,5 @@
|
||||
import {derived} from "svelte/store"
|
||||
import {synced, localStorageProvider, throttled} from "@welshman/store"
|
||||
import {synced, throttled} from "@welshman/store"
|
||||
import {pubkey, relaysByUrl} from "@welshman/app"
|
||||
import {prop, spec, identity, now, groupBy} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
@@ -13,13 +13,14 @@ import {
|
||||
makeRoomPath,
|
||||
} from "@app/util/routes"
|
||||
import {chats, hasNip29, getUrlsForEvent, userRoomsByUrl, repositoryStore} from "@app/core/state"
|
||||
import {preferencesStorageProvider} from "@src/lib/storage"
|
||||
|
||||
// Checked state
|
||||
|
||||
export const checked = synced<Record<string, number>>({
|
||||
key: "checked",
|
||||
defaultValue: {},
|
||||
storage: localStorageProvider,
|
||||
storage: preferencesStorageProvider,
|
||||
})
|
||||
|
||||
export const deriveChecked = (key: string) => derived(checked, prop(key))
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {synced, localStorageProvider} from "@welshman/store"
|
||||
import {preferencesStorageProvider} from "@src/lib/storage"
|
||||
import {synced} from "@welshman/store"
|
||||
|
||||
export const theme = synced({
|
||||
key: "theme",
|
||||
defaultValue: "dark",
|
||||
storage: localStorageProvider,
|
||||
storage: preferencesStorageProvider,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user