Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] Fix contact method back navigation #38308

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading