From d62709d54b4ba98ceb518c23dc1f43743e1c2de1 Mon Sep 17 00:00:00 2001 From: Ryan Teguh Date: Thu, 20 Nov 2025 21:55:39 +0800 Subject: [PATCH 1/2] Fix: Remove non-dismissable error message on the card page --- .../ExpensifyCardVerifyAccountPage.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx b/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx index 0bbdd493767e..feaf9deda949 100644 --- a/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx +++ b/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx @@ -4,9 +4,11 @@ import useLocalize from '@hooks/useLocalize'; import useOnyx from '@hooks/useOnyx'; import {revealVirtualCardDetails} from '@libs/actions/Card'; import {requestValidateCodeAction, resetValidateActionCodeSent} from '@libs/actions/User'; +import {getMicroSecondOnyxErrorWithTranslationKey} from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; import type {DomainCardNavigatorParamList, SettingsNavigatorParamList} from '@libs/Navigation/types'; +import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import SCREENS from '@src/SCREENS'; @@ -52,13 +54,8 @@ function ExpensifyCardVerifyAccountPage({route}: ExpensifyCardVerifyAccountPageP })); navigateBack(); }) - .catch((error: string) => { - // Displaying magic code errors is handled in the modal, no need to set it on the card - setCardsDetailsErrors((prevState) => ({ - ...prevState, - [cardID]: error, - })); - navigateBack(); + .catch((error: TranslationPaths) => { + setValidateError(getMicroSecondOnyxErrorWithTranslationKey(error)); }) .finally(() => { setIsCardDetailsLoading((prevState: Record) => ({...prevState, [cardID]: false})); From 25c91dfe3c2a115c77cbf13996a30c874875ffa9 Mon Sep 17 00:00:00 2001 From: Ryan Teguh Date: Wed, 26 Nov 2025 01:16:00 +0800 Subject: [PATCH 2/2] Fix: Remove non-dismissable error message on the Expensify card page --- .../ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx b/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx index feaf9deda949..f679cba73677 100644 --- a/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx +++ b/src/pages/settings/Wallet/ExpensifyCardPage/ExpensifyCardVerifyAccountPage.tsx @@ -55,6 +55,14 @@ function ExpensifyCardVerifyAccountPage({route}: ExpensifyCardVerifyAccountPageP navigateBack(); }) .catch((error: TranslationPaths) => { + if (error === 'cardPage.missingPrivateDetails') { + setCardsDetailsErrors((prevState) => ({ + ...prevState, + [cardID]: error, + })); + navigateBack(); + return; + } setValidateError(getMicroSecondOnyxErrorWithTranslationKey(error)); }) .finally(() => {