From 3b202b31cb4c8e92573e4ab77d0460132efcfea2 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 16 Dec 2024 11:55:47 -0800 Subject: [PATCH] Switch checked from indexedb to localstorage --- src/app/notifications.ts | 5 +++-- src/routes/+layout.svelte | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/notifications.ts b/src/app/notifications.ts index f1d2485e..a20b62fc 100644 --- a/src/app/notifications.ts +++ b/src/app/notifications.ts @@ -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 {prop, sortBy, now} from "@welshman/lib" import type {TrustedEvent} from "@welshman/util" @@ -15,7 +16,7 @@ import { // Checked state -export const checked = writable>({}) +export const checked = synced>("checked", {}) export const deriveChecked = (key: string) => derived(checked, prop(key)) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a502e6bc..eae3f3d9 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -52,7 +52,6 @@ import {subscribePersistent, listenForNotifications} from "@app/requests" import * as commands from "@app/commands" import * as requests from "@app/requests" - import {checked} from "@app/notifications" import * as notifications from "@app/notifications" import * as state from "@app/state" @@ -143,7 +142,6 @@ ready = initStorage("flotilla", 4, { relays: {keyPath: "url", store: throttled(3000, relays)}, handles: {keyPath: "nip05", store: throttled(3000, handles)}, - checked: storageAdapters.fromObjectStore(checked, {throttle: 3000}), freshness: storageAdapters.fromObjectStore(freshness, { throttle: 3000, migrate: migrateFreshness,