From 3d7661214cc03fc0fb10009e1e4f41895a815b98 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 26 Jan 2023 22:16:35 +0000 Subject: [PATCH] bug: getRelays not always available --- src/Pages/Login.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Pages/Login.tsx b/src/Pages/Login.tsx index ba62ac69..8169591f 100644 --- a/src/Pages/Login.tsx +++ b/src/Pages/Login.tsx @@ -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() {