File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
webview-ui/src/components/welcome Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,21 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
3232 useEffect ( ( ) => {
3333 if ( ! cycle ) return
3434
35+ let timeoutId : NodeJS . Timeout | undefined = undefined
3536 const intervalId = setInterval ( ( ) => {
3637 setIsFading ( true ) // Start fade out
37- setTimeout ( ( ) => {
38+ timeoutId = setTimeout ( ( ) => {
3839 setCurrentTipIndex ( ( prevIndex ) => ( prevIndex + 1 ) % tips . length )
3940 setIsFading ( false ) // Start fade in
4041 } , 1000 ) // Fade duration
4142 } , 11000 ) // 10s display + 1s fade
4243
43- return ( ) => clearInterval ( intervalId ) // Cleanup on unmount
44+ return ( ) => {
45+ clearInterval ( intervalId )
46+ if ( timeoutId ) {
47+ clearTimeout ( timeoutId )
48+ }
49+ }
4450 } , [ cycle ] )
4551
4652 const currentTip = tips [ currentTipIndex ]
You can’t perform that action at this time.
0 commit comments