Skip to content

Commit

Permalink
Merge pull request #38308 from abzokhattab/fix-contact-method-back-na…
Browse files Browse the repository at this point in the history
…vigation

[CP Staging] Fix contact method back navigation
  • Loading branch information
luacmartins authored Mar 14, 2024
2 parents cc2175d + 88d833e commit ac2d14d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/settings/Profile/Contacts/ContactMethodsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function ContactMethodsPage({loginList, session, route}: ContactMethodsPageProps
const styles = useThemeStyles();
const {formatPhoneNumber, translate} = useLocalize();
const loginNames = Object.keys(loginList ?? {});
const navigateBackTo = route?.params?.backTo || ROUTES.SETTINGS_PROFILE;
const navigateBackTo = route?.params?.backTo;

// Sort the login names by placing the one corresponding to the default contact method as the first item before displaying the contact methods.
// The default contact method is determined by checking against the session email (the current login).
Expand Down Expand Up @@ -91,10 +91,6 @@ function ContactMethodsPage({loginList, session, route}: ContactMethodsPageProps
});

const onNewContactMethodButtonPress = useCallback(() => {
if (navigateBackTo === ROUTES.SETTINGS_PROFILE) {
Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route);
return;
}
Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo));
}, [navigateBackTo]);

Expand Down

0 comments on commit ac2d14d

Please sign in to comment.