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;

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

@@ -24,6 +24,19 @@ Dir.mkdir emoji_path
Emoji.create('mattermost')
FileUtils.cp(File.join(File.dirname(__FILE__), 'images', 'icon64x64.png'), File.join(emoji_path, 'mattermost.png'))
custom_aliases = {
"ca" => "canada",
"pk" => "pakistan",
"za" => "south_africa"
}
custom_aliases.each do |custom, original|
emoji = Emoji.find_by_alias original
Emoji.edit_emoji(emoji) do |char|
char.add_alias custom
end
end
blacklist = ['basecamp', 'basecampy']
categories = []

Различия файлов скрыты, потому что одна или несколько строк слишком длинны