Skip to content

Commit

Permalink
Merge pull request #48953 from Expensify/marcaaron-handle2FAErrorMessage
Browse files Browse the repository at this point in the history
Fix translation for Reveal Card details errors
  • Loading branch information
jasperhuangg authored Sep 11, 2024
2 parents 1e8d80e + 1d2d344 commit d30bfe1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ function revealVirtualCardDetails(cardID: number, validateCode: string): Promise
API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.REVEAL_EXPENSIFY_CARD_DETAILS, parameters)
.then((response) => {
if (response?.jsonCode !== CONST.JSON_CODE.SUCCESS) {
if (response?.message === 'Incorrect or invalid magic code. Please try again.') {
// eslint-disable-next-line prefer-promise-reject-errors
reject('validateCodeForm.error.incorrectMagicCode');
return;
}

// eslint-disable-next-line prefer-promise-reject-errors
reject('cardPage.cardDetailsLoadingFailure');
return;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/Wallet/ExpensifyCardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function ExpensifyCardPage({
}
/>
<DotIndicatorMessage
messages={cardsDetailsErrors[card.cardID] ? {error: cardsDetailsErrors[card.cardID]} : {}}
messages={cardsDetailsErrors[card.cardID] ? {error: translate(cardsDetailsErrors[card.cardID] as TranslationPaths)} : {}}
type="error"
style={[styles.ph5]}
/>
Expand Down

0 comments on commit d30bfe1

Please sign in to comment.