Unverified Commit 614cfdc4 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub

Update src/redux/comments.js

Co-authored-by: default avatarKarishma Chadha <kchadha@scratch.mit.edu>
parent 581f4d0c
...@@ -70,8 +70,9 @@ module.exports.commentsReducer = (state, action) => { ...@@ -70,8 +70,9 @@ module.exports.commentsReducer = (state, action) => {
return Object.assign({}, state, { return Object.assign({}, state, {
replies: Object.assign({}, state.replies, { replies: Object.assign({}, state.replies, {
// Replies to comments go at the end of the thread // Replies to comments go at the end of the thread
[action.topLevelCommentId]: ( [action.topLevelCommentId]:
state.replies[action.topLevelCommentId] || []).concat(action.comment) (state.replies[action.topLevelCommentId] || [])
.concat(action.comment)
}), }),
comments: state.comments.map(comment => { comments: state.comments.map(comment => {
if (comment.id === action.topLevelCommentId) { if (comment.id === action.topLevelCommentId) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment