Skip to content

Commit

Permalink
also need to retain parent during refresh. maybe other properties also?
Browse files Browse the repository at this point in the history
  • Loading branch information
joenoon committed Mar 26, 2016
1 parent 6d2e5d1 commit 6da1a38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function inject(state, action, props, scenes) {
case POP_ACTION:
return {...state, index:state.index-1, children:state.children.slice(0, -1) };
case REFRESH_ACTION:
// use key from state.key to avoid losing the index_ prefix during refresh
props.key = state.key;
return {...state, ...props};
// use key and parent from state to avoid loss during refresh
let {key, parent} = state;
return {...state, ...props, key, parent};
case PUSH_ACTION:
if (state.children[state.index].sceneKey == action.key && !props.clone){
return state;
Expand Down

0 comments on commit 6da1a38

Please sign in to comment.