From c5444641f87c5e46b20980c02c3e59276caf2213 Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Tue, 10 Dec 2024 19:33:48 +0530 Subject: [PATCH] Revert "Fix new contact method isn't displayed" --- src/libs/actions/User.ts | 1 - src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/actions/User.ts b/src/libs/actions/User.ts index e23422d083ca4..20bca969468a6 100644 --- a/src/libs/actions/User.ts +++ b/src/libs/actions/User.ts @@ -443,7 +443,6 @@ function addNewContactMethod(contactMethod: string, validateCode = '') { onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.PENDING_CONTACT_ACTION, value: { - contactMethod: null, validateCodeSent: null, actionVerified: true, errorFields: { diff --git a/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx b/src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx index c6ed5ababa6ad..f662e7e4406ba 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; @@ -163,7 +162,7 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) { User.clearContactMethodErrors(addSMSDomainIfPhoneNumber(pendingContactAction?.contactMethod ?? contactMethod), 'addedLogin'); }} onClose={() => { - if (!isEmptyObject(loginData?.errorFields) && pendingContactAction?.contactMethod) { + if (loginData?.errorFields && pendingContactAction?.contactMethod) { User.clearContactMethod(pendingContactAction?.contactMethod); User.clearUnvalidatedNewContactMethodAction(); }