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
1 changed files with 8 additions and 5 deletions

View File

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