From 3e1f3de962b7995dab0aa79109bfe3dc0f89787d Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Mon, 4 Nov 2024 18:30:06 +0100 Subject: [PATCH] [chore]Refactor lexical scoping --- src/js/tabs/gps.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index c2e5933bd3..240832ed6e 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -265,15 +265,14 @@ gps.initialize = async function (callback) { rowContent += `${FC.GPS_DATA.svid[i]}`; rowContent += ``; - let quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]); - let used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]); - let usedColor; + const quality = i18n.getMessage(qualityArray[FC.GPS_DATA.quality[i] & 0x7]); + const used = i18n.getMessage(usedArray[(FC.GPS_DATA.quality[i] & 0x8) >> 3]); // Add color to the text - usedColor = quality.startsWith(i18n.getMessage('gnssQualityFullyLocked')) ? 'ready' : quality.startsWith(i18n.getMessage('gnssQualityLocked')) ? 'locked' : 'low'; - const qualityHtml = `${quality}`; + const qualityColor = quality.startsWith(i18n.getMessage('gnssQualityFullyLocked')) ? 'ready' : quality.startsWith(i18n.getMessage('gnssQualityLocked')) ? 'locked' : 'low'; + const qualityHtml = `${quality}`; - usedColor = used.startsWith(i18n.getMessage('gnssUsedUsed')) ? 'ready' : 'low'; + const usedColor = used.startsWith(i18n.getMessage('gnssUsedUsed')) ? 'ready' : 'low'; const usedHtml = `${used}`; rowContent += `${usedHtml}