diff --git a/ext/js/pages/settings/profile-controller.js b/ext/js/pages/settings/profile-controller.js index 11f5a9ea0..84dcb19ef 100644 --- a/ext/js/pages/settings/profile-controller.js +++ b/ext/js/pages/settings/profile-controller.js @@ -259,8 +259,10 @@ export class ProfileController { this._updateProfileSelectOptions(); // Update profile index - if (settingsProfileIndex === profileIndex) { - this._settingsController.profileIndex = profileCurrentNew; + if (settingsProfileIndex >= profileIndex) { + this._settingsController.profileIndex = settingsProfileIndex - 1; + } else { + this._settingsController.refreshProfileIndex(); } // Modify settings diff --git a/ext/js/pages/settings/settings-controller.js b/ext/js/pages/settings/settings-controller.js index ee44f875f..09057818f 100644 --- a/ext/js/pages/settings/settings-controller.js +++ b/ext/js/pages/settings/settings-controller.js @@ -67,6 +67,11 @@ export class SettingsController extends EventDispatcher { this._setProfileIndex(value, true); } + /** */ + refreshProfileIndex() { + this._setProfileIndex(this._profileIndex, true); + } + /** @type {HtmlTemplateCollection} */ get templates() { return this._templates;