Skip to content

Commit

Permalink
fix: Reload app when setting password (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan authored Nov 3, 2023
1 parent 53d95cd commit 13618c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/components/settings/SecurityLogin/SocialSignerMFA/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Alert,
} from '@mui/material'
import { MPC_WALLET_EVENTS } from '@/services/analytics/events/mpcWallet'
import { useRouter } from 'next/router'
import { useState, useMemo, type ChangeEvent } from 'react'
import { FormProvider, useForm } from 'react-hook-form'
import CheckIcon from '@/public/images/common/check-filled.svg'
Expand Down Expand Up @@ -78,6 +79,7 @@ const passwordStrengthMap = {
} as const

const SocialSignerMFA = () => {
const router = useRouter()
const socialWalletService = useSocialWallet()
const [passwordStrength, setPasswordStrength] = useState<PasswordStrength>()
const [submitError, setSubmitError] = useState<string>()
Expand Down Expand Up @@ -111,6 +113,9 @@ const SocialSignerMFA = () => {
)
onReset()
setOpen(false)

// This is a workaround so that the isPasswordSet and isMFAEnabled state update
router.reload()
} catch (e) {
setSubmitError('The password you entered is incorrect. Please try again.')
}
Expand Down Expand Up @@ -257,7 +262,13 @@ const SocialSignerMFA = () => {
</Track>
</Box>
</Grid>
<Grid item xs={12} md={5} p={3} sx={{ borderLeft: '1px solid #DCDEE0' }}>
<Grid
item
xs={12}
md={5}
p={3}
sx={{ borderLeft: (theme) => `1px solid ${theme.palette.border.light}` }}
>
<Box>
<LockWarningIcon />
<Typography variant="subtitle1" fontWeight="bold">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
content: counter(item);
background: var(--color-primary-main);
border-radius: 100%;
color: white;
color: var(--color-background-paper);
width: 20px;
height: 20px;
line-height: 20px;
Expand Down

0 comments on commit 13618c3

Please sign in to comment.