@@ -19,7 +19,7 @@ import useLocalize from '@hooks/useLocalize';
1919import useNetwork from '@hooks/useNetwork' ;
2020import useOnyx from '@hooks/useOnyx' ;
2121import useThemeStyles from '@hooks/useThemeStyles' ;
22- import { requestValidateCodeAction } from '@libs/actions/User' ;
22+ import { requestValidateCodeAction , resetValidateActionCodeSent } from '@libs/actions/User' ;
2323import { formatCardExpiration , getDomainCards , maskCard } from '@libs/CardUtils' ;
2424import { convertToDisplayString } from '@libs/CurrencyUtils' ;
2525import { getMicroSecondOnyxErrorWithTranslationKey } from '@libs/ErrorUtils' ;
@@ -96,6 +96,10 @@ function ExpensifyCardPage({
9696 setIsNotFound ( ! cardsToShow ) ;
9797 } , [ cardList , cardsToShow ] ) ;
9898
99+ useEffect ( ( ) => {
100+ resetValidateActionCodeSent ( ) ;
101+ } , [ ] ) ;
102+
99103 const virtualCards = useMemo ( ( ) => cardsToShow ?. filter ( ( card ) => card ?. nameValuePairs ?. isVirtual && ! card ?. nameValuePairs ?. isTravelCard ) , [ cardsToShow ] ) ;
100104 const travelCards = useMemo ( ( ) => cardsToShow ?. filter ( ( card ) => card ?. nameValuePairs ?. isVirtual && card ?. nameValuePairs ?. isTravelCard ) , [ cardsToShow ] ) ;
101105 const physicalCards = useMemo ( ( ) => cardsToShow ?. filter ( ( card ) => ! card ?. nameValuePairs ?. isVirtual ) , [ cardsToShow ] ) ;
@@ -391,7 +395,10 @@ function ExpensifyCardPage({
391395 validateError = { validateError }
392396 validateCodeActionErrorField = "revealExpensifyCardDetails"
393397 sendValidateCode = { ( ) => requestValidateCodeAction ( ) }
394- onClose = { ( ) => setIsValidateCodeActionModalVisible ( false ) }
398+ onClose = { ( ) => {
399+ setIsValidateCodeActionModalVisible ( false ) ;
400+ resetValidateActionCodeSent ( ) ;
401+ } }
395402 isVisible = { isValidateCodeActionModalVisible }
396403 title = { translate ( 'cardPage.validateCardTitle' ) }
397404 descriptionPrimary = { translate ( 'cardPage.enterMagicCode' , { contactMethod : primaryLogin } ) }
0 commit comments