Merge pull request #3806 from matrix-org/t3chguy/dedup_recent_emoji
Deduplicate recent emoji
This commit is contained in:
commit
ffd09e42bd
1 changed files with 2 additions and 4 deletions
|
@ -47,10 +47,8 @@ class EmojiPicker extends React.Component {
|
||||||
viewportHeight: 280,
|
viewportHeight: 280,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert recent emoji characters to emoji data, removing unknowns.
|
// Convert recent emoji characters to emoji data, removing unknowns and duplicates
|
||||||
this.recentlyUsed = recent.get()
|
this.recentlyUsed = Array.from(new Set(recent.get().map(getEmojiFromUnicode).filter(Boolean)));
|
||||||
.map(unicode => getEmojiFromUnicode(unicode))
|
|
||||||
.filter(data => !!data);
|
|
||||||
this.memoizedDataByCategory = {
|
this.memoizedDataByCategory = {
|
||||||
recent: this.recentlyUsed,
|
recent: this.recentlyUsed,
|
||||||
...DATA_BY_CATEGORY,
|
...DATA_BY_CATEGORY,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue