fix: patch session
Some checks failed
Deploy nsite / deploy (push) Has been cancelled

This commit is contained in:
kieran 2024-12-26 15:06:14 +00:00
parent 58e774a637
commit c4d6c154f7
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -18,6 +18,10 @@ class LoginStore extends ExternalStore<LoginSession | undefined> {
const s = window.localStorage.getItem("session"); const s = window.localStorage.getItem("session");
if (s) { if (s) {
this.#session = JSON.parse(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); const system = useContext(SnortContext);
return session return session
? { ? {
type: session.type, type: session.type,
publicKey: session.publicKey, publicKey: session.publicKey,
builder: LoginState.getSigner(), builder: LoginState.getSigner(),
system, system,
} }
: undefined; : undefined;
} }