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) => {
return Object.assign({}, state, {
replies: Object.assign({}, state.replies, {
// Replies to comments go at the end of the thread
[action.topLevelCommentId]: (
state.replies[action.topLevelCommentId] || []).concat(action.comment)
[action.topLevelCommentId]:
(state.replies[action.topLevelCommentId] || [])
.concat(action.comment)
}),
comments: state.comments.map(comment => {
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