do not modify state object directly

This commit is contained in:
Ben Wheeler 2018-08-01 16:37:48 -04:00
parent 7aa81199ce
commit d941ec1dff

View file

@ -68,9 +68,8 @@ module.exports.previewReducer = (state, action) => {
return Object.assign({}, state, {curatedStudios: action.items}); return Object.assign({}, state, {curatedStudios: action.items});
case 'ADD_PROJECT_TO_STUDIO': case 'ADD_PROJECT_TO_STUDIO':
// add studio id to our studios-that-this-project-belongs-to set. // add studio id to our studios-that-this-project-belongs-to set.
state.currentStudioIds.push(action.studioId);
return Object.assign({}, state, { return Object.assign({}, state, {
currentStudioIds: state.currentStudioIds.slice() currentStudioIds: state.currentStudioIds.concat(action.studioId)
}); });
case 'REMOVE_PROJECT_FROM_STUDIO': case 'REMOVE_PROJECT_FROM_STUDIO':
return Object.assign({}, state, { return Object.assign({}, state, {