fix(hint): arm the vs_ai idle-gate from the warm cache so the lock shows without a delay
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 17s
CI / ui (pull_request) Successful in 1m11s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 17s
CI / ui (pull_request) Successful in 1m11s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
Entering a vs_ai game from the lobby armed the idle-hint countdown only in load() (after the gameState round-trip), so the lock popped in after a visible delay. Arm it on the instant warm-cache render in onMount too — the preloadGames-warmed StateView carries hint_unlock_left_seconds; load() then refreshes the snapshot. A first move (0 seconds left) stays open.
This commit is contained in:
@@ -290,6 +290,9 @@
|
|||||||
if (cached) {
|
if (cached) {
|
||||||
view = cached.view;
|
view = cached.view;
|
||||||
moves = cached.moves;
|
moves = cached.moves;
|
||||||
|
// Arm the vs_ai idle-hint countdown from the cached seconds-left so the 🔒 shows at once on a
|
||||||
|
// warm open (no wait for load()); the cached value is a snapshot, refreshed by load() below.
|
||||||
|
armHintGate(cached.view.game.vsAi ? (cached.view.hintUnlockLeftSeconds ?? 0) : 0);
|
||||||
// Apply the cached draft synchronously so a warm/preloaded open paints the pending tiles
|
// Apply the cached draft synchronously so a warm/preloaded open paints the pending tiles
|
||||||
// already on the board (no full-rack-then-jump). load() then refreshes in the background.
|
// already on the board (no full-rack-then-jump). load() then refreshes in the background.
|
||||||
applyDraft(cached.view, cached.draft ?? '');
|
applyDraft(cached.view, cached.draft ?? '');
|
||||||
|
|||||||
Reference in New Issue
Block a user