diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-05-31 23:55:53 +0800 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-05-31 11:55:53 -0400 |
commit | 8ce72aedc3a5b4f783fb6ebab38aac8bf5f413ae (patch) | |
tree | f0c2e3b124c289ef43776631b89456e556b8149c /webapp/components | |
parent | fdf1164aee36d60b34ca82c07fe02b68e972f53a (diff) | |
download | chat-8ce72aedc3a5b4f783fb6ebab38aac8bf5f413ae.tar.gz chat-8ce72aedc3a5b4f783fb6ebab38aac8bf5f413ae.tar.bz2 chat-8ce72aedc3a5b4f783fb6ebab38aac8bf5f413ae.zip |
fix JS error when adding reaction when latest post is ephemeral (#6512)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/create_post.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx index dab1d9735..22fba0e73 100644 --- a/webapp/components/create_post.jsx +++ b/webapp/components/create_post.jsx @@ -270,11 +270,11 @@ export default class CreatePost extends React.Component { const action = isReaction[1]; const emojiName = isReaction[2]; - const postId = PostStore.getLatestPost(this.state.channelId).id; + const postId = PostStore.getLatestNonEphemeralPost(this.state.channelId).id; - if (action === '+') { + if (postId && action === '+') { PostActions.addReaction(this.state.channelId, postId, emojiName); - } else if (action === '-') { + } else if (postId && action === '-') { PostActions.removeReaction(this.state.channelId, postId, emojiName); } |