mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
settings: Call maybe_disable_widgets() in set_up() methods.
We now rely on set_up() methods to call their own module-specific versions of maybe_disable_widgets() in the codepath for admin_sections.load_admin_section(). And then for live updates, we just explicitly call all four modules that support maybe_disable_widgets(). This should make switching between sections slightly faster, and it also reduces the risk of module A messing with module B's state. (Granted, we have lots of other ways that modules can mess with each other's state.)
This commit is contained in:
@@ -4,13 +4,6 @@ var exports = {};
|
||||
|
||||
var is_loaded = new Dict(); // section -> bool
|
||||
|
||||
exports.maybe_disable_widgets = function () {
|
||||
settings_org.maybe_disable_widgets();
|
||||
settings_streams.maybe_disable_widgets();
|
||||
settings_filters.maybe_disable_widgets();
|
||||
settings_profile_fields.maybe_disable_widgets();
|
||||
};
|
||||
|
||||
exports.load_admin_section = function (name) {
|
||||
var section;
|
||||
|
||||
@@ -85,8 +78,6 @@ exports.load_admin_section = function (name) {
|
||||
return;
|
||||
}
|
||||
|
||||
exports.maybe_disable_widgets();
|
||||
|
||||
is_loaded.set(section, true);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user