Skip to content

Commit

Permalink
fix: Close popover when password recovery opens
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Nov 2, 2023
1 parent fe8451c commit b22149c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/common/ConnectWallet/WalletDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const WalletDetails = ({ onConnect }: { onConnect: () => void }): ReactElement =
</Typography>
</Divider>

<SocialSigner />
<SocialSigner onRequirePassword={onConnect} />
</>
)
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/common/SocialSigner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type SocialSignerLoginProps = {
supportedChains: ReturnType<typeof useGetSupportedChains>
isMPCLoginEnabled: ReturnType<typeof useIsSocialWalletEnabled>
onLogin?: () => void
onRequirePassword?: () => void
}

export const SocialSigner = ({
Expand All @@ -54,6 +55,7 @@ export const SocialSigner = ({
supportedChains,
isMPCLoginEnabled,
onLogin,
onRequirePassword,
}: SocialSignerLoginProps) => {
const [loginPending, setLoginPending] = useState<boolean>(false)
const [loginError, setLoginError] = useState<string | undefined>(undefined)
Expand Down Expand Up @@ -90,6 +92,8 @@ export const SocialSigner = ({
}

if (status === COREKIT_STATUS.REQUIRED_SHARE) {
onRequirePassword?.()

setTxFlow(
<PasswordRecovery recoverFactorWithPassword={recoverPassword} onSuccess={onLogin} />,
() => setLoginPending(false),
Expand Down

0 comments on commit b22149c

Please sign in to comment.