From cdc6f4b06e00c4bbb324f1e1ce26ddd8d54fd2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Wed, 16 Oct 2024 16:36:38 +0200 Subject: [PATCH 1/2] fix: reload npub when account has been changed --- src/app/screens/Home/DefaultView/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/Home/DefaultView/index.tsx b/src/app/screens/Home/DefaultView/index.tsx index 870e72603f..f3c156b1be 100644 --- a/src/app/screens/Home/DefaultView/index.tsx +++ b/src/app/screens/Home/DefaultView/index.tsx @@ -91,7 +91,7 @@ const DefaultView: FC = (props) => { if (e instanceof Error) toast.error(`Error: ${e.message}`); } })(); - }, []); + }, [account]); const unblock = async () => { try { From 366d4102cdafd6e6bddde72b9ec4aef5e78e5efb Mon Sep 17 00:00:00 2001 From: pavanjoshi914 Date: Thu, 17 Oct 2024 12:14:12 +0530 Subject: [PATCH 2/2] chore: update variable name --- src/app/screens/Home/DefaultView/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/screens/Home/DefaultView/index.tsx b/src/app/screens/Home/DefaultView/index.tsx index f3c156b1be..fda3b30d99 100644 --- a/src/app/screens/Home/DefaultView/index.tsx +++ b/src/app/screens/Home/DefaultView/index.tsx @@ -79,13 +79,13 @@ const DefaultView: FC = (props) => { useEffect(() => { (async () => { try { - const account = await api.getAccount(); - const nostrPrivateKey = await api.nostr.getPrivateKey(account.id); + const userAccount = await api.getAccount(); + const nostrPrivateKey = await api.nostr.getPrivateKey(userAccount.id); setNostrPublicKey( nostrPrivateKey ? await nostr.derivePublicKey(nostrPrivateKey) : "" ); - setCurrentAccount(account); + setCurrentAccount(userAccount); } catch (e) { console.error(e); if (e instanceof Error) toast.error(`Error: ${e.message}`);