@@ -128,11 +128,7 @@ function connectDisconnect() {
128128 return ;
129129 }
130130
131- // When rebooting, adhere to the auto-connect setting
132- if ( ! PortHandler . portPicker . autoConnect && Date . now ( ) - rebootTimestamp < REBOOT_GRACE_PERIOD_MS ) {
133- console . log ( `${ logHead } Rebooting, not connecting` ) ;
134- return ;
135- }
131+
136132
137133 const portName = selectedPort === "manual" ? PortHandler . portPicker . portOverride : selectedPort ;
138134
@@ -608,6 +604,7 @@ function finishOpen() {
608604 onConnect ( ) ;
609605
610606 GUI . selectDefaultTabWhenConnected ( ) ;
607+ rebootTimestamp = 0 ;
611608}
612609
613610function connectCli ( ) {
@@ -808,6 +805,9 @@ export function reinitializeConnection() {
808805 // Send reboot command to the flight controller
809806 MSP . send_message ( MSPCodes . MSP_SET_REBOOT , false , false ) ;
810807
808+ // Force connection invalid to ensure reboot dialog waits for reconnection
809+ CONFIGURATOR . connectionValid = false ;
810+
811811 if ( currentPort . startsWith ( "bluetooth" ) ) {
812812 if ( ! PortHandler . portPicker . autoConnect ) {
813813 return setTimeout ( function ( ) {
@@ -816,14 +816,6 @@ export function reinitializeConnection() {
816816 }
817817 }
818818
819- // Show reboot progress modal except for cli and presets tab
820- if ( [ "cli" , "presets" ] . includes ( GUI . active_tab ) ) {
821- console . log ( `${ logHead } Rebooting in ${ GUI . active_tab } tab, skipping reboot dialog` ) ;
822- gui_log ( i18n . getMessage ( "deviceRebooting" ) ) ;
823- gui_log ( i18n . getMessage ( "deviceReady" ) ) ;
824-
825- return ;
826- }
827819 // Show reboot progress modal
828820 showRebootDialog ( ) ;
829821}
@@ -926,3 +918,5 @@ function showRebootDialog() {
926918 return dialog ;
927919 }
928920}
921+
922+ GUI . reinitializeConnection = reinitializeConnection ;
0 commit comments