settings: Fix exception on updating bot_creation_policy.

This initializes the bot_creation_policy_values after the page
is loaded.

Previously we initialize these values in `settings.js` when settings page
is loaded at least once, so if we open two tabs, one(1) in which we
haven't opened the settings page yet and if in another tab (2) we
update the `bot_creation_policy` value, then because of the event
which calls `settings_bots.update_bot_permissions_ui` causes exception
in (1) because `bot_creation_policy_values` isn't initialized yet.

Fixes: #8852.
This commit is contained in:
Shubham Dhama
2018-03-29 01:52:22 +05:30
committed by Tim Abbott
parent 9f2a3c2921
commit b580c62bd4
2 changed files with 2 additions and 1 deletions

View File

@@ -122,7 +122,6 @@ function _setup_page() {
}());
setup_settings_label();
settings_bots.setup_bot_creation_policy_values();
var settings_tab = templates.render('settings_tab', {
full_name: people.my_full_name(),

View File

@@ -16,6 +16,8 @@ function _initialize() {
failure: i18n.t("Save failed"),
saving: i18n.t("Saving"),
};
settings_bots.setup_bot_creation_policy_values();
}
exports.initialize = function () {