diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-08-01 13:27:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-01 13:27:18 -0400 |
commit | 0cc5854b64756010c1d3e85a2021bf7a7010e63b (patch) | |
tree | 71767f7caa892e5fe299624eae84b0c25c2aac79 /webapp/components/post_view/reaction | |
parent | 1026b7d84c9560802c7e5bcaded90a4748951bd5 (diff) | |
download | chat-0cc5854b64756010c1d3e85a2021bf7a7010e63b.tar.gz chat-0cc5854b64756010c1d3e85a2021bf7a7010e63b.tar.bz2 chat-0cc5854b64756010c1d3e85a2021bf7a7010e63b.zip |
Fixed error thrown when viewing a channel containing an invalid emoji reaction (#7080)
* Added better error handling for when reacting with a non-existant emoji
* Re-added emoji aliases ca, za, and pk
Diffstat (limited to 'webapp/components/post_view/reaction')
-rw-r--r-- | webapp/components/post_view/reaction/index.js | 7 | ||||
-rw-r--r-- | webapp/components/post_view/reaction/reaction.jsx | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/webapp/components/post_view/reaction/index.js b/webapp/components/post_view/reaction/index.js index b19e28f8d..74edd1324 100644 --- a/webapp/components/post_view/reaction/index.js +++ b/webapp/components/post_view/reaction/index.js @@ -23,13 +23,18 @@ function makeMapStateToProps() { emoji = ownProps.emojis.get(ownProps.emojiName); } + let emojiImageUrl = ''; + if (emoji) { + emojiImageUrl = getEmojiImageUrl(emoji); + } + return { ...ownProps, profiles, otherUsersCount: ownProps.reactions.length - profiles.length, currentUserId: getCurrentUserId(state), reactionCount: ownProps.reactions.length, - emojiImageUrl: getEmojiImageUrl(emoji) + emojiImageUrl }; }; } diff --git a/webapp/components/post_view/reaction/reaction.jsx b/webapp/components/post_view/reaction/reaction.jsx index f256a1fb5..673f8fd7f 100644 --- a/webapp/components/post_view/reaction/reaction.jsx +++ b/webapp/components/post_view/reaction/reaction.jsx @@ -93,6 +93,10 @@ export default class Reaction extends React.PureComponent { } render() { + if (!this.props.emojiImageUrl) { + return null; + } + let currentUserReacted = false; const users = []; const otherUsersCount = this.props.otherUsersCount; |