diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-08-14 09:28:24 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-08-14 09:28:24 -0400 |
commit | b9aef9f2a6b90663cb7ba4ff9e42560c145b631d (patch) | |
tree | 194e31d063e31009a15b994bbc34ad6497292e17 /web/react/components/post_list.jsx | |
parent | 92c4df5b109ac8b15f6384a5c027024696bbd4d8 (diff) | |
parent | 41e74860d8abc8e33648471249b127dd3f60fb88 (diff) | |
download | chat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.tar.gz chat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.tar.bz2 chat-b9aef9f2a6b90663cb7ba4ff9e42560c145b631d.zip |
Merge pull request #360 from rgarmsen2295/mm-375d
MM-375 Adds text formatting features using a modified version of the marked js library
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r-- | web/react/components/post_list.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 83f806b79..ad7f4a8bf 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -197,7 +197,10 @@ module.exports = React.createClass({ var post = post_list.posts[msg.props.post_id]; post.message = msg.props.message; + post.lastEditDate = Date.now(); + post_list.posts[post.id] = post; + this.setState({ post_list: post_list }); PostStore.storePosts(msg.channel_id, post_list); @@ -430,8 +433,13 @@ module.exports = React.createClass({ // it is the last comment if it is last post in the channel or the next post has a different root post var isLastComment = utils.isComment(post) && (i === 0 || posts[order[i-1]].root_id != post.root_id); + var postKey = post.id; + if (post.lastEditDate) { + postKey += post.lastEditDate; + } + var postCtl = ( - <Post ref={post.id} sameUser={sameUser} sameRoot={sameRoot} post={post} parentPost={parentPost} key={post.id} + <Post ref={post.id} sameUser={sameUser} sameRoot={sameRoot} post={post} parentPost={parentPost} key={postKey} posts={posts} hideProfilePic={hideProfilePic} isLastComment={isLastComment} /> ); |