@sensiblestats/widget-react 0.60.1 → 0.60.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 +6 -0
- package/dist/index.cjs +28 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.60.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Games hub refreshes today's points, tile status, streak and rank as soon as a fan returns from a game, instead of waiting for the 60-second poll or a tab switch.
|
|
8
|
+
|
|
3
9
|
## 0.60.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -2211,6 +2211,7 @@ function useLeaderboard(conversation, { activeTab }) {
|
|
|
2211
2211
|
void doFetch();
|
|
2212
2212
|
return () => {
|
|
2213
2213
|
active = false;
|
|
2214
|
+
inFlightRef.current = false;
|
|
2214
2215
|
};
|
|
2215
2216
|
}, [activeTab, refreshCount]);
|
|
2216
2217
|
const refresh = (0, import_react7.useCallback)(() => {
|
|
@@ -6818,6 +6819,7 @@ function safeParseConfig(json) {
|
|
|
6818
6819
|
function GameScreenHost({
|
|
6819
6820
|
selected,
|
|
6820
6821
|
onBack,
|
|
6822
|
+
onPlayed,
|
|
6821
6823
|
conversation,
|
|
6822
6824
|
ui
|
|
6823
6825
|
}) {
|
|
@@ -6861,7 +6863,11 @@ function GameScreenHost({
|
|
|
6861
6863
|
const sharedProps = {
|
|
6862
6864
|
result,
|
|
6863
6865
|
submitting,
|
|
6864
|
-
|
|
6866
|
+
// Refresh only after the play is saved: a fan can tap Back while a submit is still in flight,
|
|
6867
|
+
// and a refetch fired from Back alone would read the hub's pre-play state.
|
|
6868
|
+
onSubmit: (answerJson) => {
|
|
6869
|
+
void submit(answerJson).then(() => onPlayed?.());
|
|
6870
|
+
},
|
|
6865
6871
|
ui,
|
|
6866
6872
|
onBack,
|
|
6867
6873
|
lockAtUtc
|
|
@@ -6978,7 +6984,8 @@ function GamesPanel({
|
|
|
6978
6984
|
games,
|
|
6979
6985
|
ui,
|
|
6980
6986
|
conversation,
|
|
6981
|
-
leaderboard
|
|
6987
|
+
leaderboard,
|
|
6988
|
+
refreshHub
|
|
6982
6989
|
}) {
|
|
6983
6990
|
const [selected, setSelected] = (0, import_react41.useState)(null);
|
|
6984
6991
|
(0, import_react41.useEffect)(() => {
|
|
@@ -6990,7 +6997,11 @@ function GamesPanel({
|
|
|
6990
6997
|
GameScreenHost,
|
|
6991
6998
|
{
|
|
6992
6999
|
selected,
|
|
6993
|
-
onBack: () =>
|
|
7000
|
+
onBack: () => {
|
|
7001
|
+
setSelected(null);
|
|
7002
|
+
refreshHub?.();
|
|
7003
|
+
},
|
|
7004
|
+
onPlayed: refreshHub,
|
|
6994
7005
|
conversation: conversation ?? null,
|
|
6995
7006
|
ui
|
|
6996
7007
|
}
|
|
@@ -7240,7 +7251,20 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
7240
7251
|
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TodayPanel, { discovery, ui, monitor }),
|
|
7241
7252
|
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(MatchesPanel, { monitor, ui, slip }),
|
|
7242
7253
|
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(OddsPanel, { monitor, ui, slip }),
|
|
7243
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
7254
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
7255
|
+
GamesPanel,
|
|
7256
|
+
{
|
|
7257
|
+
loggedIn: !!loggedIn,
|
|
7258
|
+
games: gamesResult.games,
|
|
7259
|
+
ui,
|
|
7260
|
+
conversation,
|
|
7261
|
+
leaderboard: leaderboardResult?.data ?? null,
|
|
7262
|
+
refreshHub: () => {
|
|
7263
|
+
gamesResult.refresh();
|
|
7264
|
+
leaderboardResult?.refresh();
|
|
7265
|
+
}
|
|
7266
|
+
}
|
|
7267
|
+
),
|
|
7244
7268
|
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
7245
7269
|
LeaderboardPanel,
|
|
7246
7270
|
{
|