Skip to content

Commit

Permalink
[chore]Refactor lexical scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Nov 4, 2024
1 parent dd7b079 commit 3e1f3de
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/js/tabs/gps.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,14 @@ gps.initialize = async function (callback) {
rowContent += `<td>${FC.GPS_DATA.svid[i]}</td>`;
rowContent += `<td><meter value="${FC.GPS_DATA.cno[i]}" max="55"></meter></td>`;

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 = `<span class="colorToggle ${usedColor}">${quality}</span>`;
const qualityColor = quality.startsWith(i18n.getMessage('gnssQualityFullyLocked')) ? 'ready' : quality.startsWith(i18n.getMessage('gnssQualityLocked')) ? 'locked' : 'low';
const qualityHtml = `<span class="colorToggle ${qualityColor}">${quality}</span>`;

usedColor = used.startsWith(i18n.getMessage('gnssUsedUsed')) ? 'ready' : 'low';
const usedColor = used.startsWith(i18n.getMessage('gnssUsedUsed')) ? 'ready' : 'low';
const usedHtml = `<span class="colorToggle ${usedColor}">${used}</span>`;

rowContent += `<td style="text-align: left; width: 17%;">${usedHtml}</td>
Expand Down

0 comments on commit 3e1f3de

Please sign in to comment.