Merge pull request #3806 from matrix-org/t3chguy/dedup_recent_emoji

Deduplicate recent emoji
pull/21833/head
Michael Telatynski 2020-01-06 13:10:28 +00:00 committed by GitHub
commit ffd09e42bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -47,10 +47,8 @@ class EmojiPicker extends React.Component {
viewportHeight: 280,
};
// Convert recent emoji characters to emoji data, removing unknowns.
this.recentlyUsed = recent.get()
.map(unicode => getEmojiFromUnicode(unicode))
.filter(data => !!data);
// Convert recent emoji characters to emoji data, removing unknowns and duplicates
this.recentlyUsed = Array.from(new Set(recent.get().map(getEmojiFromUnicode).filter(Boolean)));
this.memoizedDataByCategory = {
recent: this.recentlyUsed,
...DATA_BY_CATEGORY,