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(); }