From af7105994846dfcf38ca9efddf926806a3b39f8e Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Tue, 17 Jan 2017 14:53:28 -0700 Subject: [PATCH] Revert "My Comment bug fix" --- client/coral-framework/actions/user.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/coral-framework/actions/user.js b/client/coral-framework/actions/user.js index 7d6094ebe..f0e6f7fba 100644 --- a/client/coral-framework/actions/user.js +++ b/client/coral-framework/actions/user.js @@ -37,14 +37,10 @@ export const fetchCommentsByUserId = userId => { const state = getState(); comments.forEach(comment => dispatch(addItem(comment, 'comments'))); assets.forEach(asset => { - const prevAsset = state.items.getIn(['assets', asset.id]); - if (prevAsset) { - // Include data such as hydrated comments from assets already in the system. - dispatch(addItem({...prevAsset.toJS(), ...asset}, 'assets')); - } else { - dispatch(addItem(asset, 'assets')); - } + // Include data such as hydrated comments from assets already in the system. + const prevAsset = state.items.getIn(['assets', asset.id]).toJS(); + dispatch(addItem({...prevAsset, ...asset}, 'assets')); }); dispatch({type: actions.COMMENTS_BY_USER_SUCCESS, comments: comments.map(comment => comment.id)});