Skip to content

Commit

Permalink
Fix tab switch (betaflight#3641)
Browse files Browse the repository at this point in the history
* Fix tab switch

* Use includes instead of indexoff
  • Loading branch information
haslinghuis authored and chmelevskij committed Apr 27, 2024
1 parent e2dedb1 commit a0f8e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class GuiControl {
}
selectDefaultTabWhenConnected() {
const result = getConfig(['rememberLastTab', 'lastTab']);
const tab = result.rememberLastTab && result.lastTab ? result.lastTab : 'tab_setup';
const tab = result.rememberLastTab && result.lastTab && this.allowedTabs.includes(result.lastTab.substring(4)) ? result.lastTab : 'tab_setup';

$(`#tabs ul.mode-connected .${tab} a`).trigger('click');
}
Expand Down

0 comments on commit a0f8e90

Please sign in to comment.