Remove duplicate frequently used emojis (#7064)

th-downstream
Harmon 7 years ago committed by Eugen Rochko
parent f3db0d6ecc
commit f7c306596f

@ -38,7 +38,8 @@ const getFrequentlyUsedEmojis = createSelector([
.toArray(); .toArray();
if (emojis.length < DEFAULTS.length) { if (emojis.length < DEFAULTS.length) {
emojis = emojis.concat(DEFAULTS.slice(0, DEFAULTS.length - emojis.length)); let uniqueDefaults = DEFAULTS.filter(emoji => !emojis.includes(emoji));
emojis = emojis.concat(uniqueDefaults.slice(0, DEFAULTS.length - emojis.length));
} }
return emojis; return emojis;

Loading…
Cancel
Save