mirror of
https://git.v0l.io/Kieran/dtan.git
synced 2025-01-09 17:51:32 +00:00
This commit is contained in:
parent
58e774a637
commit
c4d6c154f7
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user