add empty object to abject assign

This commit is contained in:
Luke Schlangen committed 2019-02-03 15:16:45 -06:00
1 parent 4db64ca560
commit 4dc2501e5c
1 file changed
+4 -3
+4 -3
View File
@@ -9,14 +9,15 @@ const initialState = {
hasEverEnteredEditor: true
};
const reducer = function (state = initialState, action) {
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case SET_FULL_SCREEN:
return Object.assign(state, {
return Object.assign({}, state, {
isFullScreen: action.isFullScreen
});
case SET_PLAYER:
return Object.assign(state, {
return Object.assign({}, state, {
isPlayerOnly: action.isPlayerOnly,
hasEverEnteredEditor: state.hasEverEnteredEditor || !action.isPlayerOnly
});