@sensiblestats/widget-react 0.47.0 → 0.47.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/CHANGELOG.md +14 -0
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1538,6 +1538,9 @@ function displayMinute(state, nowMs) {
|
|
|
1538
1538
|
const advanced = base + Math.floor(age / 6e4);
|
|
1539
1539
|
return `${advanced}'`;
|
|
1540
1540
|
}
|
|
1541
|
+
function isTreatedLive(state, pollStale, nowMs) {
|
|
1542
|
+
return state?.phase === "live" && !pollStale && !isReadingStale(state, nowMs);
|
|
1543
|
+
}
|
|
1541
1544
|
|
|
1542
1545
|
// src/useMatchDiscovery.ts
|
|
1543
1546
|
var POLL_MS = 6e4;
|
|
@@ -3760,8 +3763,11 @@ function FixtureRow({ match, state, stale, nowMs, ui, monitor }) {
|
|
|
3760
3763
|
// src/components/CompetitionGroup.tsx
|
|
3761
3764
|
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3762
3765
|
function CompetitionGroup({ group, open, onToggle, states, stale, nowMs, ui, monitor, disambiguate = false }) {
|
|
3763
|
-
const own = group.matches.filter((m) => states[m.matchId]
|
|
3766
|
+
const own = group.matches.filter((m) => !isTreatedLive(states[m.matchId], stale, nowMs));
|
|
3764
3767
|
const hasLive = own.length !== group.matches.length;
|
|
3768
|
+
if (own.length === 0) {
|
|
3769
|
+
return null;
|
|
3770
|
+
}
|
|
3765
3771
|
return /* @__PURE__ */ jsxs45("div", { className: "ss-w-grp", children: [
|
|
3766
3772
|
/* @__PURE__ */ jsxs45("button", { type: "button", className: "ss-w-grp-head", "aria-expanded": open, onClick: onToggle, children: [
|
|
3767
3773
|
/* @__PURE__ */ jsx50("span", { className: "ss-w-grp-chev", children: open ? "\u25BE" : "\u25B8" }),
|
|
@@ -3784,7 +3790,7 @@ function CompetitionGroup({ group, open, onToggle, states, stale, nowMs, ui, mon
|
|
|
3784
3790
|
import { Fragment as Fragment7, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3785
3791
|
function TodayPanel({ discovery, ui, monitor }) {
|
|
3786
3792
|
const { groups, states, nowMs, stale, expanded, toggleGroup } = discovery;
|
|
3787
|
-
const liveRows = stale ? [] : groups.flatMap((group) => group.matches.filter((m) => states[m.matchId]
|
|
3793
|
+
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);
|
|
3788
3794
|
const nameCounts = groups.reduce((acc, g) => {
|
|
3789
3795
|
acc[g.competitionName] = (acc[g.competitionName] ?? 0) + 1;
|
|
3790
3796
|
return acc;
|