Skip to content

Commit

Permalink
Merge pull request #363 from DBCDK/362-back-button-error
Browse files Browse the repository at this point in the history
bugfix, fixes #362
  • Loading branch information
rasmuserik committed Feb 27, 2019
2 parents b1c8ec2 + 32e1f0b commit 9f3b64a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/redux/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,17 @@ export function root(state = initialState, action) {
return state.updateIn(['widget', 'loading'], i => i - 1);
}
case 'ADMIN_EDIT_SCREEN': {
// Bugfix: fix screen data with wrong _id when switching to them
state = state.setIn(
['quiz', 'screens', action.screen, '_id'],
action.screen
);
// Bugfix #362
if (action.screen === '') {
delete action.screen;
}
if (action.screen) {
// Bugfix: fix screen data with wrong _id when switching to them
state = state.setIn(
['quiz', 'screens', action.screen, '_id'],
action.screen
);
}

return state.setIn(['admin', 'currentScreen'], action.screen);
}
Expand Down

0 comments on commit 9f3b64a

Please sign in to comment.