diff --git a/src/js/TuningSliders.js b/src/js/TuningSliders.js index ee42b7aee9..0054e9c515 100644 --- a/src/js/TuningSliders.js +++ b/src/js/TuningSliders.js @@ -1,6 +1,8 @@ import MSP from "./msp"; import FC from "./fc"; import MSPCodes from "./msp/MSPCodes"; +import semver from 'semver'; +import { API_VERSION_1_47 } from "./data_storage"; import { isExpertModeEnabled } from "./utils/isExportModeEnabled"; import { mspHelper } from "./msp/MSPHelper"; import $ from 'jquery'; @@ -244,7 +246,9 @@ TuningSliders.updateSlidersWarning = function(slidersUnavailable = false) { const WARNING_D_MAX_GAIN = 60; const WARNING_I_GAIN = 2.5 * FC.PIDS[0][0]; const WARNING_D_GAIN = 42; - const enableWarning = FC.PIDS[0][0] > WARNING_P_GAIN || FC.PIDS[0][1] > WARNING_I_GAIN || FC.PIDS[0][2] > WARNING_D_GAIN || FC.ADVANCED_TUNING.dMaxRoll > WARNING_D_MAX_GAIN; + const enableWarning = semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_47) + ? FC.PIDS[0][0] > WARNING_P_GAIN || FC.PIDS[0][1] > WARNING_I_GAIN || FC.PIDS[0][2] > WARNING_D_MAX_GAIN || FC.ADVANCED_TUNING.dMaxRoll > WARNING_D_GAIN + : FC.PIDS[0][0] > WARNING_P_GAIN || FC.PIDS[0][1] > WARNING_I_GAIN || FC.PIDS[0][2] > WARNING_D_GAIN || FC.ADVANCED_TUNING.dMaxRoll > WARNING_D_MAX_GAIN; $('.subtab-pid .slidersWarning').toggle(enableWarning && !slidersUnavailable); };