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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1026b7d84c
Коммит
0cc5854b64
@@ -23,13 +23,18 @@ function makeMapStateToProps() {
|
|||||||
emoji = ownProps.emojis.get(ownProps.emojiName);
|
emoji = ownProps.emojis.get(ownProps.emojiName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let emojiImageUrl = '';
|
||||||
|
if (emoji) {
|
||||||
|
emojiImageUrl = getEmojiImageUrl(emoji);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...ownProps,
|
...ownProps,
|
||||||
profiles,
|
profiles,
|
||||||
otherUsersCount: ownProps.reactions.length - profiles.length,
|
otherUsersCount: ownProps.reactions.length - profiles.length,
|
||||||
currentUserId: getCurrentUserId(state),
|
currentUserId: getCurrentUserId(state),
|
||||||
reactionCount: ownProps.reactions.length,
|
reactionCount: ownProps.reactions.length,
|
||||||
emojiImageUrl: getEmojiImageUrl(emoji)
|
emojiImageUrl
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ export default class Reaction extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if (!this.props.emojiImageUrl) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let currentUserReacted = false;
|
let currentUserReacted = false;
|
||||||
const users = [];
|
const users = [];
|
||||||
const otherUsersCount = this.props.otherUsersCount;
|
const otherUsersCount = this.props.otherUsersCount;
|
||||||
|
|||||||
@@ -24,6 +24,19 @@ Dir.mkdir emoji_path
|
|||||||
Emoji.create('mattermost')
|
Emoji.create('mattermost')
|
||||||
FileUtils.cp(File.join(File.dirname(__FILE__), 'images', 'icon64x64.png'), File.join(emoji_path, 'mattermost.png'))
|
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']
|
blacklist = ['basecamp', 'basecampy']
|
||||||
|
|
||||||
categories = []
|
categories = []
|
||||||
|
|||||||
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Ссылка в новой задаче
Block a user