From 5a853e442bdad30f2f7f52b4e2f5f679feebe958 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Tue, 10 Dec 2024 22:05:42 +0700 Subject: [PATCH 1/2] fix unverified contact method is displayed --- src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx index c6ed5ababa6ad..9b24d4c125245 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx @@ -163,7 +163,7 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) { User.clearContactMethodErrors(addSMSDomainIfPhoneNumber(pendingContactAction?.contactMethod ?? contactMethod), 'addedLogin'); }} onClose={() => { - if (!isEmptyObject(loginData?.errorFields) && pendingContactAction?.contactMethod) { + if (pendingContactAction?.contactMethod) { User.clearContactMethod(pendingContactAction?.contactMethod); User.clearUnvalidatedNewContactMethodAction(); } From 3099f089901aa46dcac836b193582d206e91fbf2 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Tue, 10 Dec 2024 22:10:20 +0700 Subject: [PATCH 2/2] fix lint --- src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx index 9b24d4c125245..a2475ca3ec70b 100644 --- a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx +++ b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx @@ -30,7 +30,6 @@ import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; import INPUT_IDS from '@src/types/form/NewContactMethodForm'; import type {Errors} from '@src/types/onyx/OnyxCommon'; -import {isEmptyObject} from '@src/types/utils/EmptyObject'; type NewContactMethodPageProps = PlatformStackScreenProps;