mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-24 17:18:09 +00:00
Fixed issue with back button
This commit is contained in:
parent
484c729154
commit
7e96ad4189
@ -140,14 +140,22 @@ export default (
|
||||
};
|
||||
}
|
||||
|
||||
if (action.type === NavigationActions.NAVIGATE) {
|
||||
if (passedAction.type === 'Navigation/BACK') {
|
||||
inProgressNavigationRouteName = null;
|
||||
}
|
||||
|
||||
if (
|
||||
action.type === NavigationActions.NAVIGATE &&
|
||||
passedAction.routeName !== 'DrawerOpen' &&
|
||||
passedAction.routeName !== 'DrawerClose'
|
||||
) {
|
||||
// Check if action wants to route to the route that is in-progress navigating
|
||||
if (
|
||||
inProgressNavigationRouteName !== null &&
|
||||
inProgressNavigationRouteName === passedAction.routeName
|
||||
) {
|
||||
inProgressNavigationRouteName = null;
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
inProgressNavigationRouteName = passedAction.routeName;
|
||||
}
|
||||
@ -233,6 +241,7 @@ export default (
|
||||
}
|
||||
|
||||
if (action.type === NavigationActions.SET_PARAMS) {
|
||||
inProgressNavigationRouteName = null;
|
||||
const lastRoute = state.routes.find(
|
||||
/* $FlowFixMe */
|
||||
(route: *) => route.key === action.key
|
||||
@ -284,6 +293,7 @@ export default (
|
||||
|
||||
if (action.type === NavigationActions.BACK) {
|
||||
let backRouteIndex = null;
|
||||
inProgressNavigationRouteName = null;
|
||||
if (action.key) {
|
||||
const backRoute = state.routes.find(
|
||||
/* $FlowFixMe */
|
||||
|
Loading…
x
Reference in New Issue
Block a user