summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_list.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-07-08 11:34:34 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-08-12 11:19:42 -0700
commitd293bc0b799a679cd27ed4ef6e818b0ca96998d9 (patch)
tree6b12bb2d447cbe9cf24f0ea66ec096e6233c87d7 /web/react/components/post_list.jsx
parent95e6626f9f59b876479d8267b6c95105345e661d (diff)
downloadchat-d293bc0b799a679cd27ed4ef6e818b0ca96998d9.tar.gz
chat-d293bc0b799a679cd27ed4ef6e818b0ca96998d9.tar.bz2
chat-d293bc0b799a679cd27ed4ef6e818b0ca96998d9.zip
Implemented basic text formatting package using a modfied version of the marked js library. Supports *bold*, _italics_, and `code`
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r--web/react/components/post_list.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 83f806b79..12875ee90 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,12 @@ 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 != undefined)
+ 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}
/>
);