Skip to content

Commit

Permalink
handle editing profile index correctly when delete profile
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 committed Nov 4, 2024
1 parent d09cd38 commit e36bff8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/js/pages/settings/profile-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ export class ProfileController {
// Update profile index
if (settingsProfileIndex === profileIndex) {
this._settingsController.profileIndex = profileCurrentNew;
} else if (settingsProfileIndex > profileIndex) {
this._settingsController.profileIndex = settingsProfileIndex - 1;
} else {
this._settingsController.refreshProfileIndex();
}

// Modify settings
Expand Down
4 changes: 4 additions & 0 deletions ext/js/pages/settings/settings-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export class SettingsController extends EventDispatcher {
this._setProfileIndex(value, true);
}

refreshProfileIndex() {

Check failure on line 70 in ext/js/pages/settings/settings-controller.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Missing JSDoc comment
this._setProfileIndex(this._profileIndex, true);
}

/** @type {HtmlTemplateCollection} */
get templates() {
return this._templates;
Expand Down

0 comments on commit e36bff8

Please sign in to comment.