diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-07-26 09:27:54 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-07-26 09:27:54 -0400 |
commit | 13b7368f9df68d5f48613602d5a2fe60ac2dfd7e (patch) | |
tree | 7553360d32f609fb727f470257ad07474a1f5ff0 /webapp/components/emoji | |
parent | 564dffec35d2ab6772c2561f28d9ad9a2bcbeb40 (diff) | |
download | chat-13b7368f9df68d5f48613602d5a2fe60ac2dfd7e.tar.gz chat-13b7368f9df68d5f48613602d5a2fe60ac2dfd7e.tar.bz2 chat-13b7368f9df68d5f48613602d5a2fe60ac2dfd7e.zip |
PLT-3698 Improved handling of colons around a custom emoji's name (#3676)
Diffstat (limited to 'webapp/components/emoji')
-rw-r--r-- | webapp/components/emoji/components/add_emoji.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/components/emoji/components/add_emoji.jsx b/webapp/components/emoji/components/add_emoji.jsx index c3d61d32c..9e4babc19 100644 --- a/webapp/components/emoji/components/add_emoji.jsx +++ b/webapp/components/emoji/components/add_emoji.jsx @@ -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, |