mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-11 11:27:03 +00:00
Switch checked from indexedb to localstorage
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import {writable, derived} from "svelte/store"
|
import {derived} from "svelte/store"
|
||||||
|
import {synced} from "@welshman/store"
|
||||||
import {pubkey} from "@welshman/app"
|
import {pubkey} from "@welshman/app"
|
||||||
import {prop, sortBy, now} from "@welshman/lib"
|
import {prop, sortBy, now} from "@welshman/lib"
|
||||||
import type {TrustedEvent} from "@welshman/util"
|
import type {TrustedEvent} from "@welshman/util"
|
||||||
@@ -15,7 +16,7 @@ import {
|
|||||||
|
|
||||||
// Checked state
|
// Checked state
|
||||||
|
|
||||||
export const checked = writable<Record<string, number>>({})
|
export const checked = synced<Record<string, number>>("checked", {})
|
||||||
|
|
||||||
export const deriveChecked = (key: string) => derived(checked, prop(key))
|
export const deriveChecked = (key: string) => derived(checked, prop(key))
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@
|
|||||||
import {subscribePersistent, listenForNotifications} from "@app/requests"
|
import {subscribePersistent, listenForNotifications} from "@app/requests"
|
||||||
import * as commands from "@app/commands"
|
import * as commands from "@app/commands"
|
||||||
import * as requests from "@app/requests"
|
import * as requests from "@app/requests"
|
||||||
import {checked} from "@app/notifications"
|
|
||||||
import * as notifications from "@app/notifications"
|
import * as notifications from "@app/notifications"
|
||||||
import * as state from "@app/state"
|
import * as state from "@app/state"
|
||||||
|
|
||||||
@@ -143,7 +142,6 @@
|
|||||||
ready = initStorage("flotilla", 4, {
|
ready = initStorage("flotilla", 4, {
|
||||||
relays: {keyPath: "url", store: throttled(3000, relays)},
|
relays: {keyPath: "url", store: throttled(3000, relays)},
|
||||||
handles: {keyPath: "nip05", store: throttled(3000, handles)},
|
handles: {keyPath: "nip05", store: throttled(3000, handles)},
|
||||||
checked: storageAdapters.fromObjectStore(checked, {throttle: 3000}),
|
|
||||||
freshness: storageAdapters.fromObjectStore(freshness, {
|
freshness: storageAdapters.fromObjectStore(freshness, {
|
||||||
throttle: 3000,
|
throttle: 3000,
|
||||||
migrate: migrateFreshness,
|
migrate: migrateFreshness,
|
||||||
|
|||||||
Reference in New Issue
Block a user