Skip to content

Commit 1801ead

Browse files
committed
Fix tab switching
1 parent dd183f0 commit 1801ead

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/js/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ function startProcess() {
250250

251251
const tab = tabClass.substring(4);
252252
const tabName = $(self).text();
253+
let timeout = 0;
253254

254255
if (GUI.active_tab === 'pid_tuning') {
255256
if (TABS.pid_tuning.retainConfiguration) {
256257
TABS.pid_tuning.restoreInitialSettings();
258+
timeout = 100;
257259
}
258260
}
259261

@@ -399,9 +401,9 @@ function startProcess() {
399401
TABS.onboard_logging.initialize(content_ready);
400402
break;
401403
case 'cli':
402-
TABS.cli.initialize(content_ready, GUI.nwGui);
404+
// Add a little timeout to let MSP comands finish
405+
GUI.timeout_add('wait_for_msp_finished', () => TABS.cli.initialize(content_ready, GUI.nwGui), timeout);
403406
break;
404-
405407
default:
406408
console.log(`Tab not found: ${tab}`);
407409
}

0 commit comments

Comments
 (0)