Fix the pubkey like CHatGPT said

environments/review-chatgpt-pu-r9v77l/deployments/4657
Alex Gleason 2024-05-31 20:04:50 -05:00
rodzic 376090015e
commit 3adb570b4a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -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]);
}