@sensiblestats/widget-react 0.47.0 → 0.47.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.47.1
4
+
5
+ ### Patch Changes
6
+
7
+ - A match whose live reading has gone stale now leaves the live band as well as losing its clock,
8
+ with the band and the competition group deciding from one shared predicate so it can never fall
9
+ between them.
10
+
3
11
  ## 0.47.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1575,6 +1575,9 @@ function displayMinute(state, nowMs) {
1575
1575
  const advanced = base + Math.floor(age / 6e4);
1576
1576
  return `${advanced}'`;
1577
1577
  }
1578
+ function isTreatedLive(state, pollStale, nowMs) {
1579
+ return state?.phase === "live" && !pollStale && !isReadingStale(state, nowMs);
1580
+ }
1578
1581
 
1579
1582
  // src/useMatchDiscovery.ts
1580
1583
  var POLL_MS = 6e4;
@@ -3797,7 +3800,7 @@ function FixtureRow({ match, state, stale, nowMs, ui, monitor }) {
3797
3800
  // src/components/CompetitionGroup.tsx
3798
3801
  var import_jsx_runtime50 = require("react/jsx-runtime");
3799
3802
  function CompetitionGroup({ group, open, onToggle, states, stale, nowMs, ui, monitor, disambiguate = false }) {
3800
- const own = group.matches.filter((m) => states[m.matchId]?.phase !== "live" || stale);
3803
+ const own = group.matches.filter((m) => !isTreatedLive(states[m.matchId], stale, nowMs));
3801
3804
  const hasLive = own.length !== group.matches.length;
3802
3805
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "ss-w-grp", children: [
3803
3806
  /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { type: "button", className: "ss-w-grp-head", "aria-expanded": open, onClick: onToggle, children: [
@@ -3821,7 +3824,7 @@ function CompetitionGroup({ group, open, onToggle, states, stale, nowMs, ui, mon
3821
3824
  var import_jsx_runtime51 = require("react/jsx-runtime");
3822
3825
  function TodayPanel({ discovery, ui, monitor }) {
3823
3826
  const { groups, states, nowMs, stale, expanded, toggleGroup } = discovery;
3824
- const liveRows = stale ? [] : groups.flatMap((group) => group.matches.filter((m) => states[m.matchId]?.phase === "live").map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
3827
+ const liveRows = stale ? [] : groups.flatMap((group) => group.matches.filter((m) => isTreatedLive(states[m.matchId], stale, nowMs)).map((match) => ({ match, rank: group.rank }))).sort((a, b) => a.rank - b.rank);
3825
3828
  const nameCounts = groups.reduce((acc, g) => {
3826
3829
  acc[g.competitionName] = (acc[g.competitionName] ?? 0) + 1;
3827
3830
  return acc;