fix first comment on post failing even when it is created successfully

This commit is contained in:
Sean Yesmunt 2020-09-01 20:27:13 -04:00
parent 20f932f935
commit 404f0dc195

View file

@ -26,7 +26,7 @@ export default handleActions(
const { comment, claimId }: { comment: Comment, claimId: string } = action.data; const { comment, claimId }: { comment: Comment, claimId: string } = action.data;
const commentById = Object.assign({}, state.commentById); const commentById = Object.assign({}, state.commentById);
const byId = Object.assign({}, state.byId); const byId = Object.assign({}, state.byId);
const comments = byId[claimId]; const comments = byId[claimId] || [];
const newCommentIds = comments.slice(); const newCommentIds = comments.slice();
// add the comment by its ID // add the comment by its ID