bug: getRelays not always available

This commit is contained in:
Kieran 2023-01-26 22:16:35 +00:00
parent 4bfeb38cdf
commit 3d7661214c
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -72,12 +72,15 @@ export default function LoginPage() {
async function doNip07Login() { async function doNip07Login() {
let pubKey = await window.nostr.getPublicKey(); let pubKey = await window.nostr.getPublicKey();
let relays = await window.nostr.getRelays();
dispatch(setPublicKey(pubKey)); dispatch(setPublicKey(pubKey));
dispatch(setRelays({
relays: relays, if ("getRelays" in window.nostr) {
createdAt: 1 let relays = await window.nostr.getRelays();
})); dispatch(setRelays({
relays: relays,
createdAt: 1
}));
}
} }
function altLogins() { function altLogins() {