forked from Kieran/snort
bug: getRelays not always available
This commit is contained in:
parent
4bfeb38cdf
commit
3d7661214c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user