diff options
author | George Goldberg <george@grundleborg.com> | 2016-08-29 16:03:11 +0100 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-08-29 11:03:11 -0400 |
commit | f6c183e749820567a309adca9584f23a6ea221aa (patch) | |
tree | 6918ad158f698e7935cdf26656ae771e565bfc0c /webapp | |
parent | a76db5b84f661f1254da6d04af5100f858051bb4 (diff) | |
download | chat-f6c183e749820567a309adca9584f23a6ea221aa.tar.gz chat-f6c183e749820567a309adca9584f23a6ea221aa.tar.bz2 chat-f6c183e749820567a309adca9584f23a6ea221aa.zip |
PLT-3980 sort custom emoji alphabetically by id. (#3893)
This sorts the emoji based on their id in the custom emoji list.
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/stores/emoji_store.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/stores/emoji_store.jsx b/webapp/stores/emoji_store.jsx index 076e671dd..fd72b4636 100644 --- a/webapp/stores/emoji_store.jsx +++ b/webapp/stores/emoji_store.jsx @@ -56,6 +56,7 @@ class EmojiStore extends EventEmitter { this.addCustomEmoji(emoji); } + this.sortCustomEmojis(); this.updateEmojiMap(); } @@ -76,6 +77,10 @@ class EmojiStore extends EventEmitter { this.updateEmojiMap(); } + sortCustomEmojis() { + this.customEmojis = new Map([...this.customEmojis.entries()].sort((a, b) => a[0].localeCompare(b[0]))); + } + updateEmojiMap() { // add custom emojis to the map first so that they can't override system ones this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]); |