Clone state before updating on PROJECT_SUCCESS
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 12 Jul 2018 09:06:52 +0000 (11:06 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 12 Jul 2018 09:06:52 +0000 (11:06 +0200)
Feature #13746

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/store/project/project-reducer.ts

index 8ee9e9f916be5e95792d4fc7119b13e7b803cee3..83aa5b94de2dd1f19b73c38a205871f2186572f6 100644 (file)
@@ -129,9 +129,10 @@ const projectsReducer = (state: ProjectState = initialState, action: ProjectActi
             return state;
         },
         PROJECTS_SUCCESS: ({ projects, parentItemId }) => {
+            const items = _.cloneDeep(state.items);
             return {
                 ...state,
-                items: updateProjectTree(state.items, projects, parentItemId)
+                items: updateProjectTree(items, projects, parentItemId)
             };
         },
         TOGGLE_PROJECT_TREE_ITEM_OPEN: itemId => {