summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-11-12 08:44:18 -0500
committerJoramWilander <jwawilander@gmail.com>2015-11-12 08:44:18 -0500
commitdb861b03bdf0c4af611a24ada04414f3745d8c96 (patch)
treec6ba4176dd1be7c15a96712c26b427a810fd7062 /web/react
parent13a251a5ee940383e5a026284275b1f31fb476df (diff)
downloadchat-db861b03bdf0c4af611a24ada04414f3745d8c96.tar.gz
chat-db861b03bdf0c4af611a24ada04414f3745d8c96.tar.bz2
chat-db861b03bdf0c4af611a24ada04414f3745d8c96.zip
Fix multiple pending/errored posts
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/posts_view.jsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/react/components/posts_view.jsx b/web/react/components/posts_view.jsx
index b782268fa..52722aefc 100644
--- a/web/react/components/posts_view.jsx
+++ b/web/react/components/posts_view.jsx
@@ -104,11 +104,13 @@ export default class PostsView extends React.Component {
// check if it's the last comment in a consecutive string of comments on the same post
// 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);
+ const isLastComment = Utils.isComment(post) && (i === 0 || posts[order[i - 1]].root_id !== post.root_id);
- var postCtl = (
+ const keyPrefix = post.id ? post.id : i;
+
+ const postCtl = (
<Post
- key={post.id + 'postKey'}
+ key={keyPrefix + 'postKey'}
ref={post.id}
sameUser={sameUser}
sameRoot={sameRoot}