@sensiblestats/widget-react 0.48.1 → 0.48.2

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.
package/dist/index.js CHANGED
@@ -1498,14 +1498,15 @@ function writeSchedule(operatorId, localDate, payload, nowMs) {
1498
1498
  }
1499
1499
 
1500
1500
  // src/dueSet.ts
1501
- var WINDOW_MS = 3.5 * 36e5;
1501
+ var TERMINAL_PHASES = /* @__PURE__ */ new Set(["fullTime", "postponed"]);
1502
1502
  function dueMatchIds(groups, states, nowMs) {
1503
1503
  const due = /* @__PURE__ */ new Set();
1504
1504
  for (const group of groups) {
1505
1505
  for (const match of group.matches) {
1506
- const sinceKickoff = nowMs - match.kickoffUnix * 1e3;
1507
- if (sinceKickoff >= 0 && sinceKickoff <= WINDOW_MS) due.add(match.matchId);
1508
- if (states[match.matchId]?.phase === "live") due.add(match.matchId);
1506
+ if (nowMs - match.kickoffUnix * 1e3 < 0) continue;
1507
+ const phase = states[match.matchId]?.phase;
1508
+ if (phase !== void 0 && TERMINAL_PHASES.has(phase)) continue;
1509
+ due.add(match.matchId);
1509
1510
  }
1510
1511
  }
1511
1512
  return [...due];