@@ -473,17 +473,17 @@ export const projectState = function (state=initialState, action) {
473473 // after updating project they will be lost, so here we restore them
474474 // TODO better don't add additional values to `project` object and keep additional values separately
475475 const restoredProject = {
476- // if these arrays are not returned we should init them with empty arrays
477- // as later code counts on this
478- attachments : [ ] ,
479- members : [ ] ,
480-
481476 ...action . payload ,
482477
483478 // restore data which we put into `project` object using other reducers
484479 budget : _ . cloneDeep ( state . project . budget ) ,
485480 duration : _ . cloneDeep ( state . project . duration ) ,
486- invites : _ . cloneDeep ( state . project . invites ) ,
481+ // the next properties we also could modify by other reducers, so we restore them,
482+ // and also, we fallback to the default empty array [] as the code relies on it
483+ // we should not `cloneDeep` these values as they are not changed
484+ attachments : _ . get ( state . project , 'attachments' , [ ] ) ,
485+ members : _ . get ( state . project , 'members' , [ ] ) ,
486+ invites : _ . get ( state . project , 'invites' , [ ] ) ,
487487 }
488488
489489 return Object . assign ( { } , state , {
0 commit comments