Skip to content

Commit

Permalink
[NO CHANGELOG] [Add Tokens Widget] Fix to prevent logging out from Pa…
Browse files Browse the repository at this point in the history
…ssport if toProvider is locked (#2419)
  • Loading branch information
mimi-imtbl authored Nov 26, 2024
1 parent bf574ee commit c82b87b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function ConnectWalletDrawer({
shouldIdentifyUser = true,
}: ConnectWalletDrawerProps) {
const {
providersState: { checkout, fromProvider },
providersState: { checkout, fromProvider, lockedToProvider },
providersDispatch,
} = useProvidersContext();

Expand Down Expand Up @@ -128,7 +128,8 @@ export function ConnectWalletDrawer({
});

if (isConnected) {
if (providerType === 'from' || (providerType === 'to' && !isPassportProvider(fromProvider))) {
if ((providerType === 'from' && !lockedToProvider)
|| (providerType === 'to' && !isPassportProvider(fromProvider))) {
await checkout.passport?.logout();
}
}
Expand Down

0 comments on commit c82b87b

Please sign in to comment.