Skip to content

Commit

Permalink
Merge pull request #3254 from getAlby/fix/account-switch-npub
Browse files Browse the repository at this point in the history
fix: reload npub when account has been changed
  • Loading branch information
pavanjoshi914 authored Oct 17, 2024
2 parents f36dc49 + 366d410 commit 5d6abe6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/screens/Home/DefaultView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ const DefaultView: FC<Props> = (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}`);
}
})();
}, []);
}, [account]);

const unblock = async () => {
try {
Expand Down

0 comments on commit 5d6abe6

Please sign in to comment.