From 404f0dc195f4d580fe2103d51326d62cc202de24 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 1 Sep 2020 20:27:13 -0400 Subject: [PATCH] fix first comment on post failing even when it is created successfully --- ui/redux/reducers/comments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/redux/reducers/comments.js b/ui/redux/reducers/comments.js index 5ddb7d310..cc9553f54 100644 --- a/ui/redux/reducers/comments.js +++ b/ui/redux/reducers/comments.js @@ -26,7 +26,7 @@ export default handleActions( const { comment, claimId }: { comment: Comment, claimId: string } = action.data; const commentById = Object.assign({}, state.commentById); const byId = Object.assign({}, state.byId); - const comments = byId[claimId]; + const comments = byId[claimId] || []; const newCommentIds = comments.slice(); // add the comment by its ID