Skip to content

Commit

Permalink
Merge pull request #55998 from Krishna2323/krishna2323/issue/55490
Browse files Browse the repository at this point in the history
fix: Contact method - Two error messages appear the same time.
  • Loading branch information
carlosmiceli authored Jan 30, 2025
2 parents 43f6146 + 1c1803b commit d46c4cc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ function BaseValidateCodeForm({
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const [timeRemaining, setTimeRemaining] = useState(CONST.REQUEST_CODE_DELAY as number);
const [canShowError, setCanShowError] = useState<boolean>(false);
const latestActionVerifiedError = getLatestErrorField(validateCodeAction, 'actionVerified');

const timerRef = useRef<NodeJS.Timeout>();

@@ -184,12 +185,12 @@ function BaseValidateCodeForm({
setValidateCode(text);
setFormError({});

if (!isEmptyObject(validateError)) {
if (!isEmptyObject(validateError) || !isEmptyObject(latestActionVerifiedError)) {
clearError();
clearValidateCodeActionError('actionVerified');
}
},
[validateError, clearError],
[validateError, clearError, latestActionVerifiedError],
);

/**
@@ -243,7 +244,7 @@ function BaseValidateCodeForm({
)}
<OfflineWithFeedback
pendingAction={validateCodeAction?.pendingFields?.validateCodeSent}
errors={getLatestErrorField(validateCodeAction, 'actionVerified')}
errors={latestActionVerifiedError}
errorRowStyles={[styles.mt2]}
onClose={() => clearValidateCodeActionError('actionVerified')}
>

0 comments on commit d46c4cc

Please sign in to comment.