mirror of
https://github.com/wassname/talk.git
synced 2026-07-26 13:37:38 +08:00
Uncommenting flags and hydrating actions.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user