fix: Move selectedFrame definition before useEffect that references it

This commit is contained in:
empty
2026-01-06 17:42:44 +08:00
parent 29b6cdf709
commit 9c65610b6f

View File

@@ -86,6 +86,8 @@ export function PreviewPlayer() {
} }
}, [isPlaying, storyboard, setCurrentTime, setPlaying]) }, [isPlaying, storyboard, setCurrentTime, setPlaying])
const selectedFrame = storyboard?.frames.find((f) => f.id === selectedFrameId)
// Audio playback sync // Audio playback sync
useEffect(() => { useEffect(() => {
if (!audioRef.current) return if (!audioRef.current) return
@@ -112,8 +114,6 @@ export function PreviewPlayer() {
} }
}, [selectedFrameId]) }, [selectedFrameId])
const selectedFrame = storyboard?.frames.find((f) => f.id === selectedFrameId)
// Calculate canvas size when entering inpainting mode // Calculate canvas size when entering inpainting mode
useEffect(() => { useEffect(() => {
if (isInpaintingMode && selectedFrame?.imagePath) { if (isInpaintingMode && selectedFrame?.imagePath) {