From ed9123d66c4a139936cb425ae6ba857b5b1898c4 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Tue, 24 Mar 2026 01:38:28 +0900 Subject: [PATCH] fix: always capture reset times even at 0% usage (>= instead of >) --- src/unified-dashboard.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/unified-dashboard.ts b/src/unified-dashboard.ts index 6ebd378..dc8f3cc 100644 --- a/src/unified-dashboard.ts +++ b/src/unified-dashboard.ts @@ -800,16 +800,17 @@ async function refreshAllCodexAccountUsage(): Promise { const display = relevant.length > 0 ? relevant : usage.slice(0, 1); if (usage.length > 0) { // Find max primary (5h) and secondary (7d) across all limits + // Always capture reset times from first limit as baseline let maxH5 = 0; let maxD7 = 0; - let h5Reset: string | number | undefined; - let d7Reset: string | number | undefined; + let h5Reset: string | number | undefined = usage[0].primary.resetsAt; + let d7Reset: string | number | undefined = usage[0].secondary.resetsAt; for (const limit of usage) { - if (limit.primary.usedPercent > maxH5) { + if (limit.primary.usedPercent >= maxH5) { maxH5 = limit.primary.usedPercent; h5Reset = limit.primary.resetsAt; } - if (limit.secondary.usedPercent > maxD7) { + if (limit.secondary.usedPercent >= maxD7) { maxD7 = limit.secondary.usedPercent; d7Reset = limit.secondary.resetsAt; }