opencode-statboard 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -316,7 +316,8 @@ const server = http.createServer(async (req, res) => {
316
316
  trendReady: !!r.trend,
317
317
  }));
318
318
  } else if (u === '/api/report') {
319
- const days = parseInt(url.searchParams.get('days') || '1', 10) || 1;
319
+ const daysParam = url.searchParams.get('days');
320
+ const days = daysParam !== null ? (parseInt(daysParam, 10) || 0) : 0;
320
321
  const r = refreshReport(days);
321
322
  res.setHeader('Content-Type', 'application/json; charset=utf-8');
322
323
  res.setHeader('Cache-Control', 'no-store');