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
Этот коммит содержится в:
Harrison Healey
2017-08-01 13:27:18 -04:00
коммит произвёл GitHub
родитель 1026b7d84c
Коммит 0cc5854b64
4 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@@ -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
};
};
}

Просмотреть файл

@@ -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;