From 6dee93cecde2e647fa570d7446368fb1c8f1a706 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Thu, 8 Apr 2021 19:20:04 +0200 Subject: [PATCH] Fix OSD speed unit preview --- src/js/tabs/osd.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index f5046fe1..d885e645 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -713,7 +713,8 @@ OSD.loadDisplayFields = function() { draw_order: 810, positionable: true, preview(osdData) { - const unit = FONT.symbol(osdData.unit_mode === 0 || osdData.unit_mode === 1 ? SYM.MPH : SYM.KPH); + const UNIT_METRIC = OSD.constants.UNIT_TYPES.indexOf("METRIC"); + const unit = FONT.symbol(osdData.unit_mode === UNIT_METRIC ? SYM.KPH : SYM.MPH); return `${FONT.symbol(SYM.SPEED)}40${unit}`; }, },