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,13 +72,16 @@ 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));
if ("getRelays" in window.nostr) {
let relays = await window.nostr.getRelays();
dispatch(setRelays({ dispatch(setRelays({
relays: relays, relays: relays,
createdAt: 1 createdAt: 1
})); }));
} }
}
function altLogins() { function altLogins() {
let nip07 = 'nostr' in window; let nip07 = 'nostr' in window;