diff --git a/src/js/sensor_helpers.js b/src/js/sensor_helpers.js index a6ac394e5b..d204aab2d4 100644 --- a/src/js/sensor_helpers.js +++ b/src/js/sensor_helpers.js @@ -19,7 +19,7 @@ export function have_sensor(sensors_detected, sensor_code) { return false; } -export function sensor_status(sensors_detected, gps_fix_state) { +export function sensor_status(sensors_detected = 0, gps_fix_state = 0) { // initialize variable (if it wasn't) if (!sensor_status.previous_sensors_detected) { sensor_status.previous_sensors_detected = -1; // Otherwise first iteration will not be run if sensors_detected == 0 @@ -76,7 +76,7 @@ export function sensor_status(sensors_detected, gps_fix_state) { if (have_sensor(sensors_detected, "gps")) { $(".gps", eSensorStatus).addClass("on"); - if (gps_fix_state > 0) { + if (gps_fix_state) { $(".gpsicon", eSensorStatus).removeClass("active"); $(".gpsicon", eSensorStatus).addClass("active_fix"); } else { diff --git a/src/js/serial_backend.js b/src/js/serial_backend.js index fd2580a835..e742d0f299 100644 --- a/src/js/serial_backend.js +++ b/src/js/serial_backend.js @@ -213,7 +213,7 @@ function finishClose(finishedCallback) { $('div.connect_controls div.connect_state').text(i18n.getMessage('connect')); // reset active sensor indicators - sensor_status(0, 0); + sensor_status(); if (wasConnected) { // detach listeners and remove element data @@ -348,7 +348,7 @@ function onOpenVirtual() { processBoardInfo(); update_dataflash_global(); - sensor_status(FC.CONFIG.activeSensors, 0); + sensor_status(FC.CONFIG.activeSensors); updateTabList(FC.FEATURE_CONFIG.features); } @@ -667,7 +667,6 @@ async function getStatus() { async function update_live_status() { const statuswrapper = $('#quad-status_wrapper'); - // const sensorState = $('#sensor-status'); if (GUI.active_tab !== 'cli' && GUI.active_tab !== 'presets') { await MSP.promise(MSPCodes.MSP_BOXNAMES);