mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-18 22:05:13 +03:00
Make connection timeout dynamic
This commit is contained in:
parent
989816a2e1
commit
f8371afca2
4 changed files with 22 additions and 46 deletions
|
@ -190,15 +190,7 @@ PortHandler.detectPort = function(currentPorts) {
|
|||
if (GUI.auto_connect && !GUI.connecting_to && !GUI.connected_to) {
|
||||
// start connect procedure. We need firmware flasher protection over here
|
||||
if (GUI.active_tab !== 'firmware_flasher') {
|
||||
let connectionTimeout = 100;
|
||||
ConfigStorage.get('connectionTimeout', function (result) {
|
||||
if (result.connectionTimeout) {
|
||||
connectionTimeout = result.connectionTimeout;
|
||||
}
|
||||
GUI.timeout_add('auto-connect_timeout', function () {
|
||||
$('div#header_btns a.connect').click();
|
||||
}, connectionTimeout); // timeout so bus have time to initialize after being detected by the system
|
||||
});
|
||||
$('div#header_btns a.connect').click();
|
||||
}
|
||||
}
|
||||
// trigger callbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue