refactor: Have emoji_picker pull from emoji.

This makes it so that the authoritative holder
of all emoji data is emoji.js, and all our
UI components that need emoji data consistently
pull data from emoji.js as needed.

Or to put it another way, we no longer need the
dispatch module to know that emoji_picker is
coupled to emoji precisely by the active_realm_emojis
data; it can now make fewer assumptions.
This commit is contained in:
Steve Howell
2020-07-25 14:11:28 +00:00
committed by Tim Abbott
parent 6e9d9b42ca
commit 69c082e2f6
2 changed files with 5 additions and 3 deletions

View File

@@ -98,7 +98,9 @@ function show_emoji_catalog() {
search_is_active = false;
}
exports.rebuild_catalog = function (realm_emojis) {
exports.rebuild_catalog = function () {
const realm_emojis = emoji.active_realm_emojis;
const catalog = new Map();
catalog.set(
"Custom",
@@ -771,7 +773,7 @@ exports.register_click_handlers = function () {
};
exports.initialize = function () {
exports.rebuild_catalog(emoji.active_realm_emojis);
exports.rebuild_catalog();
};
window.emoji_picker = exports;