Make timeout run conditional instead of allowing 0

10.8-maintenance
Mark Haslinghuis 2021-11-27 19:17:12 +01:00
parent 662ff529c2
commit 87e013d200
No known key found for this signature in database
GPG Key ID: 198B0F616296A584
1 changed files with 9 additions and 2 deletions

View File

@ -255,7 +255,7 @@ function startProcess() {
if (GUI.active_tab === 'pid_tuning') {
if (TABS.pid_tuning.retainConfiguration) {
TABS.pid_tuning.restoreInitialSettings();
timeout = 100;
timeout = 500;
}
}
@ -402,7 +402,14 @@ function startProcess() {
break;
case 'cli':
// Add a little timeout to let MSP comands finish
GUI.timeout_add('wait_for_msp_finished', () => TABS.cli.initialize(content_ready, GUI.nwGui), timeout);
if (timeout > 0) {
GUI.timeout_add('wait_for_msp_finished', () => {
MSP.disconnect_cleanup();
TABS.cli.initialize(content_ready, GUI.nwGui);
}, timeout);
} else {
TABS.cli.initialize(content_ready, GUI.nwGui);
}
break;
case 'presets':
TABS.presets.initialize(content_ready, GUI.nwGui);