Skip to content

Commit

Permalink
Merge pull request #402 from joenoon/jn-refresh2
Browse files Browse the repository at this point in the history
also need to retain parent during refresh.  maybe other properties also?
  • Loading branch information
aksonov committed Mar 26, 2016
2 parents 6d2e5d1 + 6da1a38 commit 07655e8
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 07655e8

Please sign in to comment.