minor: Remove parameter to populate_emoji.

This is an easy prep step to help out phase
out page_params.realm_emoji.

All callers pass in what's effectively
page_params.realm_emoji.  (The dispatch
code does it indirectly.)
This commit is contained in:
Steve Howell 2020-07-23 22:42:44 +00:00 committed by Anders Kaseorg
parent 4f195de78d
commit d11c6686a1
2 changed files with 6 additions and 4 deletions

View File

@ -218,7 +218,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
// can display it properly when reopened without refresh.
page_params.realm_emoji = event.realm_emoji;
emoji.update_emojis(event.realm_emoji);
settings_emoji.populate_emoji(event.realm_emoji);
settings_emoji.populate_emoji();
emoji_picker.generate_emoji_picker_data(emoji.active_realm_emojis);
composebox_typeahead.update_emoji_data();
break;

View File

@ -45,7 +45,7 @@ exports.update_custom_emoji_ui = function () {
$(".admin-emoji-form").show();
}
exports.populate_emoji(page_params.realm_emoji);
exports.populate_emoji();
};
exports.reset = function () {
@ -61,11 +61,13 @@ function sort_author_full_name(a, b) {
return -1;
}
exports.populate_emoji = function (emoji_data) {
exports.populate_emoji = function () {
if (!meta.loaded) {
return;
}
const emoji_data = page_params.realm_emoji;
for (const emoji of Object.values(emoji_data)) {
// Add people.js data for the user here.
if (emoji.author_id !== null) {
@ -141,7 +143,7 @@ exports.set_up = function () {
loading.make_indicator($("#admin_page_emoji_loading_indicator"));
// Populate emoji table
exports.populate_emoji(page_params.realm_emoji);
exports.populate_emoji();
$(".admin_emoji_table").on("click", ".delete", function (e) {
e.preventDefault();