File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ export const KeyFramePreviewer = () => {
100100 useEffect ( ( ) => {
101101 if ( ! keyFrames || isAnimating . current ) return ;
102102 const keyFrameList = Array . from ( keyFrames . keys ( ) ) . sort ( ( a , b ) => a - b )
103+ if ( keyFrameList . length == 0 ) return ;
103104 const keyFrameIdx = Math . max ( keyFrameList . findLastIndex ( n => n <= currentFrame ) , 0 )
104105 const startFrame = keyFrameList [ keyFrameIdx ]
105106 if ( keyFrameIdx + 1 < keyFrameList . length ) {
Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ const KeyFrames = () => {
6363 const keyFrameList = keyFrames ? Array . from ( keyFrames . keys ( ) ) . sort ( ( a , b ) => a - b ) : null ;
6464 const originalAnimProg = useRef < number | null > ( null )
6565
66+ useEffect ( ( ) => { // Clear KeyFrames if it is empty.
67+ if ( keyFrameList && keyFrameList . length == 0 ) {
68+ useImageExportStore . setState ( { keyFrames : undefined } )
69+ }
70+ } , [ keyFrameList ] )
71+
6672 useEffect ( ( ) => {
6773 originalAnimProg . current = animProg ;
6874 return ( ) => {
You can’t perform that action at this time.
0 commit comments