Update pomade implementation

This commit is contained in:
Jon Staab
2026-03-05 14:20:20 -08:00
parent eeacaca725
commit 71f162f20d
12 changed files with 530 additions and 232 deletions
+25
View File
@@ -0,0 +1,25 @@
import {get} from "svelte/store"
import {Client} from "@pomade/core"
import {getPubkey} from "@welshman/util"
import {session, isPomadeSession} from "@welshman/app"
import {kv, db} from "@app/core/storage"
import {Push} from "@app/util/notifications"
export const logout = async () => {
const $session = get(session)
if ($session && isPomadeSession($session)) {
await new Client($session.clientOptions).deactivateSession(
getPubkey($session.clientOptions.secret),
$session.clientOptions.peers,
)
}
await Push.disable()
await kv.clear()
await db.clear()
localStorage.clear()
window.location.href = "/"
}