Speed up initial login

This commit is contained in:
Jon Staab
2024-12-03 16:18:36 -08:00
parent 1ea39c1d56
commit efb0528f76
5 changed files with 38 additions and 31 deletions
+6 -3
View File
@@ -25,7 +25,9 @@
const abortController = new AbortController()
const relays = [normalizeRelayUrl("ws://" + stripProtocol(BURROW_URL))]
const relays = BURROW_URL.startsWith('http://')
? [normalizeRelayUrl("ws://" + stripProtocol(BURROW_URL))]
: [normalizeRelayUrl(BURROW_URL)]
const broker = Nip46Broker.get({clientSecret, relays})
@@ -78,15 +80,16 @@
const userPubkey = await broker.getPublicKey()
await loadUserData(userPubkey)
addSession({
email,
method: "nip46",
pubkey: userPubkey,
secret: clientSecret,
handler: {pubkey: response.event.pubkey, relays},
})
await loadUserData(userPubkey)
setChecked("*")
clearModals()
}