1- import { useClerk , useReverification , useSession , useUser } from '@clerk/shared/react' ;
1+ import { useReverification , useUser } from '@clerk/shared/react' ;
22import type { PhoneNumberResource , UserResource } from '@clerk/shared/types' ;
33import React , { useRef } from 'react' ;
44
55import { useWizard , Wizard } from '@/common' ;
66import { MfaBackupCodeList } from '@/components/UserProfile/MfaBackupCodeList' ;
7- import { useEnvironment } from '@/contexts' ;
8- import { useSessionTasksContext , useTaskSetupMFAContext } from '@/contexts/components/SessionTasks' ;
97import { Action , Actions } from '@/elements/Actions' ;
108import { useCardState } from '@/elements/contexts' ;
119import { Form } from '@/elements/Form' ;
1210import { FormButtonContainer } from '@/elements/FormButtons' ;
1311import { PreviewButton } from '@/elements/PreviewButton' ;
12+ import { type VerificationCodeCardProps , VerificationCodeContent } from '@/elements/VerificationCodeCard' ;
1413import { Add } from '@/icons' ;
15- import { useRouter } from '@/router' ;
1614import { Button , Col , descriptors , Flex , Flow , localizationKeys , Text } from '@/ui/customizables' ;
1715import { Card } from '@/ui/elements/Card' ;
1816import { Header } from '@/ui/elements/Header' ;
@@ -22,7 +20,6 @@ import { getFlagEmojiFromCountryIso, parsePhoneString, stringToFormattedPhoneStr
2220import { useFormControl } from '@/ui/utils/useFormControl' ;
2321
2422import { SharedFooterActionForSignOut } from './shared' ;
25- import { VerificationCodeContent , type VerificationCodeCardProps } from '@/elements/VerificationCodeCard' ;
2623
2724type MFAVerifyPhoneForSessionTasksProps = {
2825 resourceRef : React . MutableRefObject < PhoneNumberResource | undefined > ;
@@ -43,8 +40,8 @@ const MFAVerifyPhoneForSessionTasks = (props: MFAVerifyPhoneForSessionTasksProps
4340 const enableMfa = async ( ) => {
4441 card . setLoading ( phone ?. id ) ;
4542 try {
46- await setReservedForSecondFactor ( ) ;
47- resourceRef . current = phone ;
43+ const result = await setReservedForSecondFactor ( ) ;
44+ resourceRef . current = result ;
4845 onSuccess ( ) ;
4946 } catch ( err ) {
5047 handleError ( err as Error , [ ] , card . setError ) ;
@@ -213,8 +210,8 @@ const PhoneItem = ({ phone, onSuccess, onUnverifiedPhoneClick, resourceRef }: Ph
213210
214211 card . setLoading ( phone . id ) ;
215212 try {
216- await setReservedForSecondFactor ( ) ;
217- resourceRef . current = phone ;
213+ const result = await setReservedForSecondFactor ( ) ;
214+ resourceRef . current = result ;
218215 onSuccess ( ) ;
219216 } catch ( err ) {
220217 handleError ( err as Error , [ ] , card . setError ) ;
@@ -315,7 +312,7 @@ const SmsCodeScreen = (props: SmsCodeScreenProps) => {
315312 width : t . sizes . $8 ,
316313 height : t . sizes . $6 ,
317314 } ) }
318- > </ Action >
315+ / >
319316 </ Actions >
320317 < Flex
321318 justify = 'center'
0 commit comments