From fb099298b81f98d75ad48ee68a726f718059e9a6 Mon Sep 17 00:00:00 2001 From: cTn Date: Sun, 30 Mar 2014 12:13:17 +0200 Subject: [PATCH] bugfix for profile select UI not updating in sync --- tabs/pid_tuning.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index b132d378a2..dd9ae2fb92 100644 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -2,7 +2,12 @@ function tab_initialize_pid_tuning() { ga_tracker.sendAppView('PID Tuning'); GUI.active_tab = 'pid_tuning'; - send_message(MSP_codes.MSP_PID, MSP_codes.MSP_PID, false, get_rc_tuning_data); + // requesting MSP_STATUS manually because it contains CONFIG.profile + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS, false, get_pid_data); + + function get_pid_data() { + send_message(MSP_codes.MSP_PID, MSP_codes.MSP_PID, false, get_rc_tuning_data); + } function get_rc_tuning_data() { send_message(MSP_codes.MSP_RC_TUNING, MSP_codes.MSP_RC_TUNING, false, load_html); @@ -158,9 +163,7 @@ function tab_initialize_pid_tuning() { send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function() { GUI.log('Loaded Profile: ' + profile + ''); - GUI.tab_switch_cleanup(function() { - tab_initialize_pid_tuning(); - }); + GUI.tab_switch_cleanup(tab_initialize_pid_tuning); }); });