Rework subscription storage

This commit is contained in:
Jon Staab
2026-01-23 16:51:02 -08:00
parent 2528e4acad
commit 646b8f8736
6 changed files with 219 additions and 170 deletions
+6 -12
View File
@@ -28,7 +28,7 @@
import {setupAnalytics} from "@app/util/analytics"
import {authPolicy, blockPolicy, trustPolicy, mostlyRestrictedPolicy} from "@app/util/policies"
import {kv, db} from "@app/core/storage"
import {userSettingsValues} from "@app/core/state"
import {userSettingsValues, notificationSettings} from "@app/core/state"
import {syncApplicationData} from "@app/core/sync"
import * as commands from "@app/core/commands"
import * as requests from "@app/core/requests"
@@ -44,17 +44,6 @@
const policies = [authPolicy, blockPolicy, trustPolicy, mostlyRestrictedPolicy]
PushNotifications.addListener(
"pushNotificationActionPerformed",
async (action: ActionPerformed) => {
console.log('====== action', JSON.stringify(action))
const event = parseJson(action.notification.data.event)
const relays = [action.notification.data.relay]
goto(await getEventPath(event, relays))
},
)
// Add stuff to window for convenience
Object.assign(window, {
get,
@@ -114,6 +103,11 @@
store: shouldUnwrap,
storage: kv,
}),
sync({
key: "notificationSettings",
store: notificationSettings,
storage: kv,
}),
])
// Set up our storage adapters