Skip to content

Commit

Permalink
Hotfix 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo mathieu committed Apr 21, 2016
1 parent 6637257 commit 44db597
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/meteorSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = (getMeteorData) => {
componentWillMount() {
this.onChange = (props)=>{

const hasNewProps = !!props;

props = props && props.name ? props : this.props;

const navState = props.navigationState;
Expand All @@ -20,11 +22,14 @@ module.exports = (getMeteorData) => {
const selected = navState.children.filter(el=>el.sceneKey==selectedKey) || console.error("key="+selectedKey+" doesn't exist");
const navigationState = selected[0] || console.error("Cannot find scene with key="+selectedKey);


if (navigationState.key != navState.children[navState.index].key){
Actions[selectedKey]();
this.setState({navigationState});
}

if(hasNewProps) {
this.setState({navigationState});
}

};

this.onChange();
Expand Down

0 comments on commit 44db597

Please sign in to comment.