From c82b87bbab92096b96ae9e74b9ea3b58ece71daf Mon Sep 17 00:00:00 2001 From: Mimi Tran <80493680+mimi-imtbl@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:32:36 +1100 Subject: [PATCH] [NO CHANGELOG] [Add Tokens Widget] Fix to prevent logging out from Passport if toProvider is locked (#2419) --- .../src/components/WalletDrawer/ConnectWalletDrawer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/checkout/widgets-lib/src/components/WalletDrawer/ConnectWalletDrawer.tsx b/packages/checkout/widgets-lib/src/components/WalletDrawer/ConnectWalletDrawer.tsx index 833a0a055a..b1f4120910 100644 --- a/packages/checkout/widgets-lib/src/components/WalletDrawer/ConnectWalletDrawer.tsx +++ b/packages/checkout/widgets-lib/src/components/WalletDrawer/ConnectWalletDrawer.tsx @@ -63,7 +63,7 @@ export function ConnectWalletDrawer({ shouldIdentifyUser = true, }: ConnectWalletDrawerProps) { const { - providersState: { checkout, fromProvider }, + providersState: { checkout, fromProvider, lockedToProvider }, providersDispatch, } = useProvidersContext(); @@ -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(); } }