forked from coracle/flotilla
Use capacitor preferences package instead of localStorage
This commit is contained in:
committed by
Jon Staab
parent
2672a8f922
commit
c94d314f6d
@@ -78,6 +78,7 @@ import {
|
||||
userRoomsByUrl,
|
||||
userSettingsValues,
|
||||
} from "@app/core/state"
|
||||
import {preferencesStorageProvider} from "@src/lib/storage"
|
||||
|
||||
// Utils
|
||||
|
||||
@@ -124,6 +125,7 @@ export const logout = async () => {
|
||||
await clearStorage()
|
||||
|
||||
localStorage.clear()
|
||||
await preferencesStorageProvider.clear()
|
||||
}
|
||||
|
||||
// Synchronization
|
||||
|
||||
@@ -31,7 +31,6 @@ import {
|
||||
deriveEventsMapped,
|
||||
withGetter,
|
||||
synced,
|
||||
localStorageProvider,
|
||||
} from "@welshman/store"
|
||||
import {
|
||||
getIdFilters,
|
||||
@@ -97,6 +96,7 @@ import {
|
||||
publishThunk,
|
||||
} from "@welshman/app"
|
||||
import type {Thunk, Relay} from "@welshman/app"
|
||||
import {preferencesStorageProvider} from "@src/lib/storage"
|
||||
|
||||
export const fromCsv = (s: string) => (s || "").split(",").filter(identity)
|
||||
|
||||
@@ -317,7 +317,7 @@ netContext.isEventValid = (event: TrustedEvent, url: string) =>
|
||||
export const canDecrypt = synced({
|
||||
key: "canDecrypt",
|
||||
defaultValue: false,
|
||||
storage: localStorageProvider,
|
||||
storage: preferencesStorageProvider,
|
||||
})
|
||||
|
||||
export const SETTINGS = "flotilla/settings"
|
||||
|
||||
Reference in New Issue
Block a user