(hopefully) fix multiple accounts issue

environments/review-fix-multip-wpob2c/deployments/4749
Siddharth Singh 2024-08-02 23:04:25 +05:30
rodzic af9bb284fa
commit c073278167
Nie znaleziono w bazie danych klucza dla tego podpisu
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -27,6 +27,8 @@ function logInNostr(pubkey: string) {
secret,
}));
dispatch(setNostrPubkey(undefined));
const { access_token } = dispatch(authLoggedIn(token));
return await dispatch(verifyCredentials(access_token as string));
};
@ -43,7 +45,7 @@ function nostrExtensionLogIn() {
};
}
function setNostrPubkey(pubkey: string) {
function setNostrPubkey(pubkey: string | undefined) {
return {
type: NOSTR_PUBKEY_SET,
pubkey,

Wyświetl plik

@ -28,7 +28,7 @@ export const NostrProvider: React.FC<NostrProviderProps> = ({ children }) => {
const { account } = useOwnAccount();
const url = instance.nostr?.relay;
const accountPubkey = useAppSelector((state) => account?.nostr.pubkey ?? state.meta.pubkey);
const accountPubkey = useAppSelector((state) => state.meta.pubkey ?? account?.nostr.pubkey);
const signer = useMemo(
() => (accountPubkey ? NKeys.get(accountPubkey) : undefined) ?? window.nostr,