Skip to content

Commit 07655e8

Browse files
committed
Merge pull request #402 from joenoon/jn-refresh2
also need to retain parent during refresh. maybe other properties also?
2 parents 6d2e5d1 + 6da1a38 commit 07655e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Reducer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function inject(state, action, props, scenes) {
3434
case POP_ACTION:
3535
return {...state, index:state.index-1, children:state.children.slice(0, -1) };
3636
case REFRESH_ACTION:
37-
// use key from state.key to avoid losing the index_ prefix during refresh
38-
props.key = state.key;
39-
return {...state, ...props};
37+
// use key and parent from state to avoid loss during refresh
38+
let {key, parent} = state;
39+
return {...state, ...props, key, parent};
4040
case PUSH_ACTION:
4141
if (state.children[state.index].sceneKey == action.key && !props.clone){
4242
return state;

0 commit comments

Comments
 (0)