Skip to content

Commit

Permalink
fixed BACK action consumption when TabRouter is not back eligible
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-François Puissant committed Mar 27, 2018
1 parent 084c52e commit 1190099
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/routers/TabRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ export default (
// handle the action, to allow inner tabs to change first
let activeTabIndex = state.index;
const isBackEligible =
action.key == null || action.key === activeTabLastState.key;
if (
action.type === NavigationActions.BACK &&
isBackEligible &&
shouldBackNavigateToInitialRoute
) {
activeTabIndex = initialRouteIndex;
!action.key || action.key === activeTabLastState.key;
if (action.type === NavigationActions.BACK) {
if (isBackEligible && shouldBackNavigateToInitialRoute) {
activeTabIndex = initialRouteIndex;
} else {
return state;
}
}
let didNavigate = false;
if (action.type === NavigationActions.NAVIGATE) {
Expand Down

0 comments on commit 1190099

Please sign in to comment.