Skip to content

Commit

Permalink
Merge pull request Expensify#36774 from neonbhai/recovery-code-input-fix
Browse files Browse the repository at this point in the history
Recovery code input fix
  • Loading branch information
puneetlath authored Mar 13, 2024
2 parents 0c371aa + a5d9fe2 commit 077824c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,6 @@ const CONST = {
MAGIC_CODE_LENGTH: 6,
MAGIC_CODE_EMPTY_CHAR: ' ',

RECOVERY_CODE_LENGTH: 8,

KEYBOARD_TYPE: {
VISIBLE_PASSWORD: 'visible-password',
ASCII_CAPABLE: 'ascii-capable',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function BaseValidateCodeForm({account, credentials, session, autoComplete, isUs
setTwoFactorAuthCode(text);
}
if (key === 'recoveryCode') {
setRecoveryCode(text);
setRecoveryCode(text.trim());
}

setFormError((prevError) => ({...prevError, [key]: undefined}));
Expand Down Expand Up @@ -290,7 +290,7 @@ function BaseValidateCodeForm({account, credentials, session, autoComplete, isUs
accessibilityLabel={translate('recoveryCodeForm.recoveryCode')}
value={recoveryCode}
onChangeText={(text) => onTextInput(text, 'recoveryCode')}
maxLength={CONST.RECOVERY_CODE_LENGTH}
maxLength={CONST.FORM_CHARACTER_LIMIT}
label={translate('recoveryCodeForm.recoveryCode')}
errorText={formError?.recoveryCode ?? ''}
hasError={hasError}
Expand Down

0 comments on commit 077824c

Please sign in to comment.