Skip to content

Commit cf0e3c8

Browse files
committed
Fix cycle time for real this time
1 parent b037d9c commit cf0e3c8

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

app/src/pages/Monitor.svelte

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,9 @@
197197
}, 1000);
198198
199199
let lastCycleTimeInterval = setInterval(() => {
200-
if (lastCycleTimeMS !== frameHandler.getLastCycleTime()) {
201-
// console.log("Cycle time is not matching", {
202-
// current: lastCycleTimeMS,
203-
// new: frameHandler.getLastCycleTime(),
204-
// });
205-
lastCycleTimeMS = frameHandler.getLastCycleTime() || 0;
200+
const newMs = frameHandler.getLastCycleTime();
201+
if (newMs !== undefined && newMs !== null && lastCycleTimeMS !== newMs) {
202+
lastCycleTimeMS = newMs;
206203
lastCycleTime = formatTimeShortNoAgoSeconds(lastCycleTimeMS);
207204
}
208205
}, 1000);

app/src/util/updater.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ interface Version {
1111
}
1212

1313
export const VERSIONS: { [key: string]: Version } = {
14+
"2.7.3.2": {
15+
changelog: `
16+
<h1 class="text-lg font-bold">v2.7.3.2</h1>
17+
<ul>
18+
<li>Fixed cycle time data from scraping extension</li>
19+
<li>Added "FTA Buddy Native" to extension, add FTA Buddy features to the official field monitor</li>
20+
<li>Fix match log fetching in scraping and notepad only mode</li>
21+
</ul>`
22+
},
1423
"2.7.3.1": {
1524
changelog: `
1625
<h1 class="text-lg font-bold">v2.7.3.1</h1>

extension/src/injected-overlay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ function updateFooter(
149149
}
150150
}
151151

152-
// C: last cycle — prefer server string, treat "unk" sentinel as no data
152+
// C: last cycle — convert server "M:SS" string to formatted display
153153
const rawLast = serverCycleData?.lastCycleTime;
154-
const lastStr = (rawLast && rawLast !== "unk") ? rawLast : "—";
154+
const lastStr = (rawLast && rawLast !== "unk") ? formatCycleMs(cycleTimeToMS(rawLast)) : "—";
155155

156156
// A: average — prefer server ms value
157157
const avgMs = serverCycleData?.averageCycleTime ?? null;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"extension",
66
"userscript"
77
],
8-
"version": "2.7.3.1",
8+
"version": "2.7.3.2",
99
"description": "",
1010
"scripts": {
1111
"start": "bun run ./src/index.ts",

userscript/src/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function updateStation(
436436
if (validBatVals.length > 0) {
437437
const sorted = [...validBatVals].sort((a, b) => a - b);
438438
const minBat = sorted[Math.floor(sorted.length * 0.02)] ?? sorted[0];
439-
els.batSub.textContent = `min: ${minBat.toFixed(1)}v`;
439+
els.batSub.textContent = `${minBat.toFixed(1)}v`;
440440
els.batSub.style.color = minBat < 7.8 ? "#dc2626" : "#9e9e9e";
441441
} else {
442442
els.batSub.textContent = "";

0 commit comments

Comments
 (0)