From 03276a73111b0e2041932892311165bd72b03c3e Mon Sep 17 00:00:00 2001 From: daledah Date: Fri, 6 Dec 2024 11:49:56 +0700 Subject: [PATCH] fix: validate code not sent on create card page --- src/libs/actions/User.ts | 10 ++++++++++ .../expensifyCard/issueNew/ConfirmationStep.tsx | 1 + 2 files changed, 11 insertions(+) diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index 20bca969468a..306962e45ff4 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -284,6 +284,15 @@ function clearValidateCodeActionError(fieldName: string) { }); } +/** + * Reset validateCodeSent on validate action code. + */ +function resetValidateActionCodeSent() { + Onyx.merge(ONYXKEYS.VALIDATE_ACTION_CODE, { + validateCodeSent: false, + }); +} + /** * Clears any possible stored errors for a specific field on a contact method */ @@ -1425,4 +1434,5 @@ export { subscribeToActiveGuides, dismissGBRTooltip, setIsDebugModeEnabled, + resetValidateActionCodeSent, }; diff --git a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx index c65ae8957dbe..07b888aaa5f0 100644 --- a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx @@ -51,6 +51,7 @@ function ConfirmationStep({policyID, backTo}: ConfirmationStepProps) { useEffect(() => { submitButton.current?.focus(); + User.resetValidateActionCodeSent(); }, []); useEffect(() => {