@sensiblestats/widget-react 0.95.1 → 0.96.0

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
@@ -1099,7 +1099,7 @@ function isEnglishLocale(locale) {
1099
1099
  }
1100
1100
 
1101
1101
  // src/version.generated.ts
1102
- var WIDGET_REACT_VERSION = "0.95.1";
1102
+ var WIDGET_REACT_VERSION = "0.96.0";
1103
1103
 
1104
1104
  // src/config.ts
1105
1105
  function normalizeUi(cfg) {
@@ -7544,18 +7544,20 @@ function Roster({ bundle, players, side, ui, slip }) {
7544
7544
  function NbaPropsSection({ match, monitor, ui, slip }) {
7545
7545
  const [side, setSide] = useState34("home");
7546
7546
  const [, setTick] = useState34(0);
7547
- const open = preTip(match);
7547
+ const pre = preTip(match);
7548
+ const live = match.phase === "live";
7549
+ const open = pre || live;
7548
7550
  useEffect25(() => {
7549
7551
  if (open) monitor.loadPlayerProps?.(match.matchId);
7550
7552
  }, [match.matchId, match.asOfUtc, open]);
7551
7553
  useEffect25(() => {
7552
- if (!open || !match.kickoffUtc) return;
7554
+ if (!pre || !match.kickoffUtc) return;
7553
7555
  const wait = Math.min(Math.max(Date.parse(match.kickoffUtc) - Date.now(), 0), MAX_TIMER_MS);
7554
7556
  const id = setTimeout(() => setTick((t) => t + 1), wait);
7555
7557
  return () => clearTimeout(id);
7556
- }, [open, match.kickoffUtc]);
7558
+ }, [pre, match.kickoffUtc]);
7557
7559
  const bundle = monitor.playerProps?.[match.matchId]?.bundle;
7558
- if (!open || !bundle || bundle.players.length === 0) return null;
7560
+ if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
7559
7561
  const bySide = (s) => bundle.players.filter((p) => p.side === s);
7560
7562
  const other = side === "home" ? "away" : "home";
7561
7563
  const shown = bySide(side).length > 0 ? side : other;