From a2c9b8194611ab4e2e55e44934b4c4281c940154 Mon Sep 17 00:00:00 2001 From: Malik Zulqurnain Date: Mon, 12 Feb 2024 21:12:54 +0500 Subject: [PATCH 1/2] Fix auto auth case for mobile devices --- .../client/scripts/hooks/useWallets.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/commonwealth/client/scripts/hooks/useWallets.tsx b/packages/commonwealth/client/scripts/hooks/useWallets.tsx index dc27d84b53f..b4152828906 100644 --- a/packages/commonwealth/client/scripts/hooks/useWallets.tsx +++ b/packages/commonwealth/client/scripts/hooks/useWallets.tsx @@ -641,7 +641,16 @@ const useWallets = (walletProps: IuseWalletProps) => { setSignerAccount(signingAccount); setIsNewlyCreated(newlyCreated); setIsLinkingOnMobile(isLinkingWallet); - setActiveStep('redirectToSign'); + if (featureFlags.newSignInModal) { + onAccountVerified( + signingAccount, + newlyCreated, + isLinkingWallet, + wallet, + ); + } else { + setActiveStep('redirectToSign'); + } } else { onAccountVerified( signingAccount, @@ -724,7 +733,11 @@ const useWallets = (walletProps: IuseWalletProps) => { if (setSignerAccount) setSignerAccount(account); if (setIsNewlyCreated) setIsNewlyCreated(false); if (setIsLinkingOnMobile) setIsLinkingOnMobile(false); - setActiveStep('redirectToSign'); + if (featureFlags.newSignInModal) { + onAccountVerified(account, false, false); + } else { + setActiveStep('redirectToSign'); + } return; } else { onAccountVerified(account, false, false); From f1624caa6584c95a420f84b60e7d89aa08d07143 Mon Sep 17 00:00:00 2001 From: Malik Zulqurnain Date: Mon, 12 Feb 2024 21:38:21 +0500 Subject: [PATCH 2/2] Fix page refresh on landing page --- .../commonwealth/client/scripts/views/pages/landing/header.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/commonwealth/client/scripts/views/pages/landing/header.tsx b/packages/commonwealth/client/scripts/views/pages/landing/header.tsx index 4804a41d77c..836143d4a8f 100644 --- a/packages/commonwealth/client/scripts/views/pages/landing/header.tsx +++ b/packages/commonwealth/client/scripts/views/pages/landing/header.tsx @@ -61,8 +61,9 @@ export const Header = ({ onLogin }: HeaderProps) => { /> ) : ( setIsAuthModalOpen(false)} + onSuccess={onLogin} isOpen={isAuthModalOpen} + onClose={() => setIsAuthModalOpen(false)} /> )}