Skip to content

Commit

Permalink
fix goBack
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgrzybowski committed Dec 19, 2023
1 parent a725b49 commit f496947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function goBack(fallbackRoute: Route, shouldEnforceFallback = false, shouldPopTo
const rootState = navigationRef.getRootState();
const lastRoute = rootState.routes.at(-1);
// If the user comes from a different flow (there is more than one route in ModalNavigator) we should go back to the previous flow on UP button press instead of using the fallbackRoute.
if (lastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || (lastRoute?.name === NAVIGATORS.LEFT_MODAL_NAVIGATOR && (lastRoute.state?.index ?? 0) > 0)) {
if ((lastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || lastRoute?.name === NAVIGATORS.LEFT_MODAL_NAVIGATOR) && (lastRoute.state?.index ?? 0) > 0) {
navigationRef.current.goBack();
return;
}
Expand Down

0 comments on commit f496947

Please sign in to comment.