kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'fix-multiple-accounts' into 'main'
(hopefully) fix multiple accounts issue Closes #1672 See merge request soapbox-pub/soapbox!3087environments/review-main-yi2y9f/deployments/4751
commit
429494e902
|
@ -27,6 +27,8 @@ function logInNostr(pubkey: string) {
|
||||||
secret,
|
secret,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
dispatch(setNostrPubkey(undefined));
|
||||||
|
|
||||||
const { access_token } = dispatch(authLoggedIn(token));
|
const { access_token } = dispatch(authLoggedIn(token));
|
||||||
return await dispatch(verifyCredentials(access_token as string));
|
return await dispatch(verifyCredentials(access_token as string));
|
||||||
};
|
};
|
||||||
|
@ -43,7 +45,7 @@ function nostrExtensionLogIn() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNostrPubkey(pubkey: string) {
|
function setNostrPubkey(pubkey: string | undefined) {
|
||||||
return {
|
return {
|
||||||
type: NOSTR_PUBKEY_SET,
|
type: NOSTR_PUBKEY_SET,
|
||||||
pubkey,
|
pubkey,
|
||||||
|
|
|
@ -28,7 +28,7 @@ export const NostrProvider: React.FC<NostrProviderProps> = ({ children }) => {
|
||||||
const { account } = useOwnAccount();
|
const { account } = useOwnAccount();
|
||||||
|
|
||||||
const url = instance.nostr?.relay;
|
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(
|
const signer = useMemo(
|
||||||
() => (accountPubkey ? NKeys.get(accountPubkey) : undefined) ?? window.nostr,
|
() => (accountPubkey ? NKeys.get(accountPubkey) : undefined) ?? window.nostr,
|
||||||
|
|
Ładowanie…
Reference in New Issue