Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Commit

Permalink
Fix an error with ExNavigationReducer
Browse files Browse the repository at this point in the history
  • Loading branch information
isnifer committed Nov 17, 2017
1 parent 98b1c01 commit 5e32ff8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ExNavigationReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ class ExNavigationReducer {
}

static [ActionTypes.REMOVE_NAVIGATOR](state, { navigatorUID }) {
const currentNavigatorUID =
(navigatorsToRestore.length &&
navigatorsToRestore[navigatorsToRestore.length - 1]) ||
state.navigators[navigatorUID].parentNavigatorUID;
let currentNavigatorUID = null
if (navigatorsToRestore.length) {
currentNavigatorUID = navigatorsToRestore[navigatorsToRestore.length - 1])
} else if (state.navigators[navigatorUID]) {
currentNavigatorUID = state.navigators[navigatorUID].parentNavigatorUID
}
navigatorsToRestore.pop();
return {
...state,
Expand Down

0 comments on commit 5e32ff8

Please sign in to comment.