Remove frequentlyUsedEmoji defaults
This commit is contained in:
parent
181ffc75cc
commit
8ad449cb13
|
@ -55,41 +55,15 @@ export interface IEmojiPickerDropdown {
|
||||||
const perLine = 8;
|
const perLine = 8;
|
||||||
const lines = 2;
|
const lines = 2;
|
||||||
|
|
||||||
const DEFAULTS = [
|
|
||||||
'+1',
|
|
||||||
'grinning',
|
|
||||||
'kissing_heart',
|
|
||||||
'heart_eyes',
|
|
||||||
'laughing',
|
|
||||||
'stuck_out_tongue_winking_eye',
|
|
||||||
'sweat_smile',
|
|
||||||
'joy',
|
|
||||||
'yum',
|
|
||||||
'disappointed',
|
|
||||||
'thinking_face',
|
|
||||||
'weary',
|
|
||||||
'sob',
|
|
||||||
'sunglasses',
|
|
||||||
'heart',
|
|
||||||
'ok_hand',
|
|
||||||
];
|
|
||||||
|
|
||||||
export const getFrequentlyUsedEmojis = createSelector([
|
export const getFrequentlyUsedEmojis = createSelector([
|
||||||
(state: RootState) => state.settings.get('frequentlyUsedEmojis', ImmutableMap()),
|
(state: RootState) => state.settings.get('frequentlyUsedEmojis', ImmutableMap()),
|
||||||
], (emojiCounters: ImmutableMap<string, number>) => {
|
], (emojiCounters: ImmutableMap<string, number>) => {
|
||||||
let emojis = emojiCounters
|
return emojiCounters
|
||||||
.keySeq()
|
.keySeq()
|
||||||
.sort((a, b) => emojiCounters.get(a)! - emojiCounters.get(b)!)
|
.sort((a, b) => emojiCounters.get(a)! - emojiCounters.get(b)!)
|
||||||
.reverse()
|
.reverse()
|
||||||
.slice(0, perLine * lines)
|
.slice(0, perLine * lines)
|
||||||
.toArray();
|
.toArray();
|
||||||
|
|
||||||
if (emojis.length < DEFAULTS.length) {
|
|
||||||
const uniqueDefaults = DEFAULTS.filter(emoji => !emojis.includes(emoji));
|
|
||||||
emojis = emojis.concat(uniqueDefaults.slice(0, DEFAULTS.length - emojis.length));
|
|
||||||
}
|
|
||||||
|
|
||||||
return emojis;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Filter custom emojis to only ones visible in the picker, and sort them alphabetically. */
|
/** Filter custom emojis to only ones visible in the picker, and sort them alphabetically. */
|
||||||
|
|
Loading…
Reference in New Issue