fix(play): resolve hydration mismatch and fragile pace index

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuanzonghao
2026-06-07 14:23:44 +08:00
parent dc36b1fe9e
commit 69ae1380cb
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -580,10 +580,7 @@ function PlayInner() {
// Once the player dismisses the silence nudge, keep it gone for this session.
const [nudgeDismissed, setNudgeDismissed] = useState(false);
const [settingsOpen, setSettingsOpen] = useState(false);
const [visionClickEnabled, setVisionClickEnabled] = useState<boolean>(() => {
if (typeof window === "undefined") return true;
return readStoredVisionClick();
});
const [visionClickEnabled, setVisionClickEnabled] = useState(true);
const startedRef = useRef(false);
const poolRef = useRef<Map<string, PrefetchEntry>>(new Map());
@@ -653,6 +650,9 @@ function PlayInner() {
useEffect(() => {
mutedRef.current = muted;
}, [muted]);
useEffect(() => {
setVisionClickEnabled(readStoredVisionClick());
}, []);
// Coarse liveness ping for active-time analytics. /play is a single SPA
// route, so page views alone read as ~0 duration; a 30s heartbeat (only