Merge branch 'main' into feat-choose-zaps-amount

This commit is contained in:
P. Reis 2024-05-31 22:32:48 -03:00
commit 95dbb7bb85
1 changed files with 11 additions and 2 deletions

View File

@ -14,9 +14,19 @@ function useSignerStream() {
const authStorageKey = `soapbox:nostr:auth:${pubkey}`;
useEffect(() => {
let isCancelled = false;
if (signer) {
signer.getPublicKey().then((pubkey) => setPubkey(pubkey)).catch(console.warn);
signer.getPublicKey().then((newPubkey) => {
if (!isCancelled) {
setPubkey(newPubkey);
}
}).catch(console.warn);
}
return () => {
isCancelled = true;
};
}, [signer]);
useEffect(() => {
@ -36,7 +46,6 @@ function useSignerStream() {
return () => {
connect.close();
};
}, [relay, signer, pubkey]);
}