Uncommenting flags and hydrating actions.

This commit is contained in:
David Jay
2016-11-09 13:42:03 -05:00
parent 07db6b3f9c
commit 6616cf0c51
2 changed files with 21 additions and 19 deletions
+12 -16
View File
@@ -123,14 +123,12 @@ class CommentStream extends Component {
<PubDate created_at={comment.created_at}/>
<Content body={comment.body}/>
<div className="commentActions">
{
// <Flag
// addNotification={this.props.addNotification}
// id={commentId}
// flag={comment.flag}
// postAction={this.props.postAction}
// currentUser={this.props.auth.user}/>
}
<Flag
addNotification={this.props.addNotification}
id={commentId}
flag={comment.flag}
postAction={this.props.postAction}
currentUser={this.props.auth.user}/>
<ReplyButton
updateItem={this.props.updateItem}
id={commentId}/>
@@ -153,14 +151,12 @@ class CommentStream extends Component {
<PubDate created_at={reply.created_at}/>
<Content body={reply.body}/>
<div className="replyActions">
{
// <Flag
// addNotificiation={this.props.addNotification}
// id={replyId}
// flag={reply.flag}
// postAction={this.props.postAction}
// currentUser={this.props.auth.user}/>
}
<Flag
addNotificiation={this.props.addNotification}
id={replyId}
flag={reply.flag}
postAction={this.props.postAction}
currentUser={this.props.auth.user}/>
<ReplyButton
updateItem={this.props.updateItem}
parent_id={reply.parent_id}/>
@@ -121,9 +121,15 @@ export function getStream (assetId) {
comments: rootComments
}))
const keys = Object.keys(childComments)
for (var i=0; i < keys.length; i++ ) {
dispatch(updateItem(keys[i], 'children', childComments[keys[i]].reverse()))
const childKeys = Object.keys(childComments)
for (var i=0; i < childKeys.length; i++ ) {
dispatch(updateItem(childKeys[i], 'children', childComments[childKeys[i]].reverse()))
}
/* Hydrate actions on comments */
const actions = Object.keys(json.actions)
for (var i=0; i < actions.length; i++ ) {
dispatch(updateItem(actions[i].item_id, actions[i].type, actions[i].id))
}
return (json)