From f473ab98e2e25b14711bde0093493774514a4591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Troed=20S=C3=A5ngberg?= Date: Sun, 14 Jun 2026 19:45:19 +0200 Subject: [PATCH] fix: bump UI on failure=null to clear n/a when server is idle --- package.json | 2 +- tui.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index dee564f..4d866ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@troed/oc-ls-stats", - "version": "1.0.8", + "version": "1.0.10", "type": "module", "exports": { "./tui": { diff --git a/tui.tsx b/tui.tsx index dc59734..78f1f05 100644 --- a/tui.tsx +++ b/tui.tsx @@ -313,6 +313,7 @@ const tui: TuiPlugin = async (api) => { continue } tracker.failure = null + bump() debug(`poll baseUrl=${baseUrl} slots=${JSON.stringify(slotList)}`) @@ -324,7 +325,13 @@ const tui: TuiPlugin = async (api) => { for (const slotId of prevProcessingSlotIds) { if (!currProcessingSlotIds.has(slotId)) { - delete tracker.prevNdBySlot[slotId] + const prev = tracker.prevNdBySlot[slotId] + if (prev) { + prev.hasIncreased = false + prev.baseline = 0 + } else { + delete tracker.prevNdBySlot[slotId] + } } }