Skip to content

Commit 8298cd9

Browse files
authored
Merge pull request Expensify#63243 from nkdengineer/fix/62264
fix: removing unvalidated contact, back button reopens same page
2 parents 89df90e + f2fcc9e commit 8298cd9

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/pages/settings/Profile/Contacts/NewContactMethodPage.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) {
5353
const loginData = loginList?.[pendingContactAction?.contactMethod ?? contactMethod];
5454
const validateLoginError = getLatestErrorField(loginData, 'addedLogin');
5555

56-
const navigateBackTo = route?.params?.backTo ?? ROUTES.SETTINGS_PROFILE.getRoute();
56+
const navigateBackTo = route?.params?.backTo;
5757

5858
const hasFailedToSendVerificationCode = !!pendingContactAction?.errorFields?.actionVerified;
5959

@@ -122,10 +122,6 @@ function NewContactMethodPage({route}: NewContactMethodPageProps) {
122122
);
123123

124124
const onBackButtonPress = useCallback(() => {
125-
if (navigateBackTo === ROUTES.SETTINGS_PROFILE.getRoute()) {
126-
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route);
127-
return;
128-
}
129125
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo));
130126
}, [navigateBackTo]);
131127

0 commit comments

Comments
 (0)