PLT-3698 Improved handling of colons around a custom emoji's name (#3676)

Этот коммит содержится в:
Harrison Healey
2016-07-26 09:27:54 -04:00
коммит произвёл Joram Wilander
родитель 564dffec35
Коммит 13b7368f9d

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

@@ -56,6 +56,11 @@ export default class AddEmoji extends React.Component {
name: this.state.name.trim().toLowerCase()
};
// trim surrounding colons if the user accidentally included them in the name
if (emoji.name.startsWith(':') && emoji.name.endsWith(':')) {
emoji.name = emoji.name.substring(1, emoji.name.length - 1);
}
if (!emoji.name) {
this.setState({
saving: false,