Merge branch 'master' into master

This commit is contained in:
Matt Hamil
2017-09-20 14:40:37 -05:00
committed by GitHub

View File

@@ -75,6 +75,8 @@ export default (
paths[routeName] = { re, keys, toPath: pathToRegexp.compile(pathPattern) };
});
let inProgressNavigationRouteName = null;
return {
getComponentForState(state: NavigationState): NavigationComponent {
const activeChildRoute = state.routes[state.index];
@@ -141,6 +143,26 @@ export default (
};
}
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;
}
inProgressNavigationRouteName = passedAction.routeName;
}
// Check if a child scene wants to handle the action as long as it is not a reset to the root stack
if (action.type !== NavigationActions.RESET || action.key !== null) {
const keyIndex = action.key
@@ -222,6 +244,7 @@ export default (
}
if (action.type === NavigationActions.SET_PARAMS) {
inProgressNavigationRouteName = null;
const lastRoute = state.routes.find(
/* $FlowFixMe */
(route: *) => route.key === action.key
@@ -273,6 +296,7 @@ export default (
if (action.type === NavigationActions.BACK) {
let backRouteIndex = null;
inProgressNavigationRouteName = null;
if (action.key) {
const backRoute = state.routes.find(
/* $FlowFixMe */