@@ -2,8 +2,6 @@ import "./jqueryPlugins";
22import $ from "jquery" ;
33import "../components/init.js" ;
44import { gui_log } from "./gui_log.js" ;
5- // same, msp seems to be everywhere used from global scope
6- import "./msp/MSPHelper.js" ;
75import { i18n } from "./localization.js" ;
86import GUI , { TABS } from "./gui.js" ;
97import { get as getConfig , set as setConfig } from "./ConfigStorage.js" ;
@@ -184,13 +182,18 @@ function startProcess() {
184182 return ;
185183 }
186184
187- if ( GUI . allowedTabs . indexOf ( tab ) < 0 && tab === "firmware_flasher" ) {
188- if ( GUI . connected_to || GUI . connecting_to ) {
189- $ ( "a.connection_button__link" ) . click ( ) ;
185+ if ( ! GUI . allowedTabs . includes ( tab ) ) {
186+ if ( tab === "firmware_flasher" ) {
187+ // Special handling for firmware flasher tab
188+ if ( GUI . connected_to || GUI . connecting_to ) {
189+ $ ( "a.connection_button__link" ) . trigger ( "click" ) ;
190+ }
191+ // This line is required but it triggers opening the firmware flasher tab again
192+ $ ( "a.firmware_flasher_button__link" ) . trigger ( "click" ) ;
193+ } else {
194+ gui_log ( i18n . getMessage ( "tabSwitchUpgradeRequired" , [ tabName ] ) ) ;
195+ return ;
190196 }
191- } else if ( GUI . allowedTabs . indexOf ( tab ) < 0 ) {
192- gui_log ( i18n . getMessage ( "tabSwitchUpgradeRequired" , [ tabName ] ) ) ;
193- return ;
194197 }
195198
196199 GUI . tab_switch_in_progress = true ;
0 commit comments