Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@RocketChat/core
Closes #6636
This changes are intended to fix the exception that was happening when changing the Emoji Picker filter text, which was caused by some race conditions with Blaze computations and the jquery used to clear the emoji picker window for the dynamic categories (recent and rocket).
I aimed at removing the jquery code that was a fix for the duplication bug for these categories, which was being caused by some bad structure on the UI. The fix I found was to add a new reactive variable as a flag, so whenever we need to update the dynamic categories, the flag would be set as true and the UI would react properly (see emojiPicker.js:268 and emojiPicker.js:282).
I noticed a small change that could improve the performance of the Emoji Picker rendering, because we were adding all the emojis to the categories, even when we didn't show those categories, and this would happen again every time we changed categories. Now the emojiList only renders the emojis for the selected category (see emojiList.js:132), let me know if this is not something we want (since the html would be incomplete).
The major change is on the emojiList.js updateRecent function, where we no longer return an html, but only trigger structural changes and let the UI update reactively. Although we have to check if there is an active instance, since this changes can be triggered when removing custom emojis from the admin panel.
This is my first time touching some of this stuff, so feedback here is much appreciated.