diff --git a/webapp/stores/emoji_store.jsx b/webapp/stores/emoji_store.jsx index 076e671dd3..fd72b46365 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]);