Skip to content

Commit

Permalink
Merge pull request #29195 from hoangzinh/fix/28254
Browse files Browse the repository at this point in the history
Fix App allows changing to use the 2FA code option when signning in with recovery code
  • Loading branch information
Li357 authored Oct 11, 2023
2 parents c952f9c + 888c6f6 commit 6f0d7af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ function BaseValidateCodeForm(props) {
const hasError = Boolean(props.account) && !_.isEmpty(props.account.errors);
const isLoadingResendValidationForm = props.account.loadingForm === CONST.FORMS.RESEND_VALIDATE_CODE_FORM;
const shouldDisableResendValidateCode = props.network.isOffline || props.account.isLoading;
const isValidateCodeFormSubmitting =
props.account.isLoading && props.account.loadingForm === (props.account.requiresTwoFactorAuth ? CONST.FORMS.VALIDATE_TFA_CODE_FORM : CONST.FORMS.VALIDATE_CODE_FORM);

useEffect(() => {
if (!(inputValidateCodeRef.current && hasError && (props.session.autoAuthState === CONST.AUTO_AUTH_STATE.FAILED || props.account.isLoading))) {
Expand Down Expand Up @@ -327,6 +329,7 @@ function BaseValidateCodeForm(props) {
underlayColor={themeColors.componentBG}
hoverDimmingValue={1}
pressDimmingValue={0.2}
disabled={isValidateCodeFormSubmitting}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
accessibilityLabel={props.isUsingRecoveryCode ? props.translate('recoveryCodeForm.use2fa') : props.translate('recoveryCodeForm.useRecoveryCode')}
>
Expand Down Expand Up @@ -379,9 +382,7 @@ function BaseValidateCodeForm(props) {
success
style={[styles.mv3]}
text={props.translate('common.signIn')}
isLoading={
props.account.isLoading && props.account.loadingForm === (props.account.requiresTwoFactorAuth ? CONST.FORMS.VALIDATE_TFA_CODE_FORM : CONST.FORMS.VALIDATE_CODE_FORM)
}
isLoading={isValidateCodeFormSubmitting}
onPress={validateAndSubmitForm}
/>
<ChangeExpensifyLoginLink onPress={clearSignInData} />
Expand Down

0 comments on commit 6f0d7af

Please sign in to comment.