log resume prompt effect state for debug
This commit is contained in:
@@ -389,11 +389,20 @@ export default function PlayerPage() {
|
||||
}, [id, setPanel])
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('[player] resume prompt effect', {
|
||||
resumeItemId,
|
||||
alreadyShown: resumePromptShownRef.current === resumeItemId,
|
||||
pos: Number(resumePositionTicks ?? 0),
|
||||
showResumePromptPref,
|
||||
})
|
||||
}
|
||||
if (!resumeItemId || resumePromptShownRef.current === resumeItemId) return
|
||||
const pos = Number(resumePositionTicks ?? 0)
|
||||
const thresholdSec = usePreferencesStore.getState().resumeThresholdSec ?? 5
|
||||
const threshold = thresholdSec * 10_000_000
|
||||
if (showResumePromptPref && pos > threshold) {
|
||||
if (typeof window !== 'undefined') console.log('[player] resume prompt opening')
|
||||
setResumePromptOpen(true)
|
||||
resumePromptShownRef.current = resumeItemId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user