Add eject flow

This commit is contained in:
Jon Staab
2024-12-04 10:10:41 -08:00
parent efb0528f76
commit 2e05eee9e7
4 changed files with 123 additions and 9 deletions
+15
View File
@@ -46,6 +46,8 @@ import {
loadRelay,
addSession,
subscribe,
clearStorage,
dropSession,
} from "@welshman/app"
import {
COMMENT,
@@ -149,6 +151,19 @@ export const loginWithNip46 = async ({
return true
}
// Log out
export const logout = async () => {
const $pubkey = pubkey.get()
if ($pubkey) {
dropSession($pubkey)
}
await clearStorage()
localStorage.clear()
}
// Loaders
export const loadUserData = (