From 212b0bdb1133c968f4720c3e4a32495fc04a5cbd Mon Sep 17 00:00:00 2001 From: haslinghuis Date: Tue, 6 Dec 2022 12:20:52 +0100 Subject: [PATCH] Fix virtual OSD elements and OSD backwards compability bug (#3118) --- src/js/VirtualFC.js | 2 +- src/js/tabs/osd.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/js/VirtualFC.js b/src/js/VirtualFC.js index 56fa793b..ad822d3e 100644 --- a/src/js/VirtualFC.js +++ b/src/js/VirtualFC.js @@ -182,7 +182,7 @@ const VirtualFC = { virtualOSD.data.unit_mode = 1; virtualOSD.virtualMode = { - itemPositions: Array.from({length: 60}), + itemPositions: Array.from({length: 77}), statisticsState: [], warningFlags: 0, timerData: [], diff --git a/src/js/tabs/osd.js b/src/js/tabs/osd.js index 8550b1b9..73d968a9 100644 --- a/src/js/tabs/osd.js +++ b/src/js/tabs/osd.js @@ -2790,16 +2790,14 @@ osd.initialize = function(callback) { } // 2 way binding... sorta - function updateOsdView() { + async function updateOsdView() { // ask for the OSD canvas data - let p; if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45)) { - p = MSP.promise(MSPCodes.MSP_OSD_CANVAS); + await MSP.promise(MSPCodes.MSP_OSD_CANVAS); } - // ask for the OSD config data - p.then(() => MSP.promise(MSPCodes.MSP_OSD_CONFIG)) + MSP.promise(MSPCodes.MSP_OSD_CONFIG) .then(info => { OSD.chooseFields();