From c4d6c154f7ac61e4f98d6837e96aee2a41834da7 Mon Sep 17 00:00:00 2001 From: kieran Date: Thu, 26 Dec 2024 15:06:14 +0000 Subject: [PATCH] fix: patch session --- src/login.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/login.tsx b/src/login.tsx index 1516c44..fa8483a 100644 --- a/src/login.tsx +++ b/src/login.tsx @@ -18,6 +18,10 @@ class LoginStore extends ExternalStore { const s = window.localStorage.getItem("session"); if (s) { this.#session = JSON.parse(s); + // patch session + if (this.#session) { + this.#session.type ??= "nip7"; + } } } @@ -103,10 +107,10 @@ export function useLogin() { const system = useContext(SnortContext); return session ? { - type: session.type, - publicKey: session.publicKey, - builder: LoginState.getSigner(), - system, - } + type: session.type, + publicKey: session.publicKey, + builder: LoginState.getSigner(), + system, + } : undefined; }