From 7408f6bd3d100199f068fafd259ebb1afaaf65a0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 23 Sep 2020 20:23:09 -0700 Subject: [PATCH] setup: Add setter for password_change_in_progress. After migration to an ES6 module, `password_change_in_progress` would no longer be mutable from outside the module. Signed-off-by: Anders Kaseorg --- static/js/settings_account.js | 6 +++--- static/js/setup.js | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/settings_account.js b/static/js/settings_account.js index b5dbfaba37..93d300c327 100644 --- a/static/js/settings_account.js +++ b/static/js/settings_account.js @@ -448,14 +448,14 @@ exports.set_up = function () { } } - setup.password_change_in_progress = true; + setup.set_password_change_in_progress(true); const opts = { success_continuation() { - setup.password_change_in_progress = false; + setup.set_password_change_in_progress(false); overlays.close_modal("#change_password_modal"); }, error_continuation() { - setup.password_change_in_progress = false; + setup.set_password_change_in_progress(false); }, error_msg_element: change_password_error, }; diff --git a/static/js/setup.js b/static/js/setup.js index 19c70f2353..fdc9884daf 100644 --- a/static/js/setup.js +++ b/static/js/setup.js @@ -4,6 +4,11 @@ const util = require("./util"); // Miscellaneous early setup. exports.password_change_in_progress = false; + +exports.set_password_change_in_progress = function (value) { + exports.password_change_in_progress = value; +}; + $(() => { if (util.is_mobile()) { // Disable the tutorial; it's ugly on mobile.