Skip to content

Commit

Permalink
Use jsonCode instead of error message
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Sep 12, 2024
1 parent 0046c6f commit e44b522
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ const CONST = {
MANY_WRITES_ERROR: 665,
UNABLE_TO_RETRY: 'unableToRetry',
UPDATE_REQUIRED: 426,
INCORRECT_MAGIC_CODE: 451,
},
HTTP_STATUS: {
// When Cloudflare throttles
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ 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.') {
if (response?.jsonCode === CONST.JSON_CODE.INCORRECT_MAGIC_CODE) {
// eslint-disable-next-line prefer-promise-reject-errors
reject('validateCodeForm.error.incorrectMagicCode');
return;
Expand Down

0 comments on commit e44b522

Please sign in to comment.