Skip to content
Snippets Groups Projects
Commit 4bb3e4ee authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix #5295 - Order custom emoji lexicographically (#5297)

parent 784c7510
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,23 @@ const getFrequentlyUsedEmojis = createSelector([
.toArray()
);
const getCustomEmojis = createSelector([
state => state.get('custom_emojis'),
], emojis => emojis.sort((a, b) => {
const aShort = a.get('shortcode').toLowerCase();
const bShort = b.get('shortcode').toLowerCase();
if (aShort < bShort) {
return -1;
} else if (aShort > bShort ) {
return 1;
} else {
return 0;
}
}));
const mapStateToProps = state => ({
custom_emojis: state.get('custom_emojis'),
custom_emojis: getCustomEmojis(state),
autoPlay: state.getIn(['meta', 'auto_play_gif']),
skinTone: state.getIn(['settings', 'skinTone']),
frequentlyUsedEmojis: getFrequentlyUsedEmojis(state),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment