Reverting last commit (#2626)

This commit is contained in:
Matt Hamil 2017-09-20 15:08:11 -05:00 committed by GitHub
parent 7832ed72c0
commit 2b40182cd7

View File

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