Skip to content

Commit

Permalink
Fix sign-in request branch case for mobile devices when signing in wi…
Browse files Browse the repository at this point in the history
…th mobile wallets (#6704)

* Fix auto auth case for mobile devices

* Fix page refresh on landing page
  • Loading branch information
mzparacha authored Feb 12, 2024
1 parent 14d979f commit c05f6e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
17 changes: 15 additions & 2 deletions packages/commonwealth/client/scripts/hooks/useWallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ export const Header = ({ onLogin }: HeaderProps) => {
/>
) : (
<AuthModal
onClose={() => setIsAuthModalOpen(false)}
onSuccess={onLogin}
isOpen={isAuthModalOpen}
onClose={() => setIsAuthModalOpen(false)}
/>
)}
</>
Expand Down

0 comments on commit c05f6e9

Please sign in to comment.