File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/opencode/src/cli/cmd/tui/routes/session Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -25,24 +25,27 @@ export function Footer() {
2525 } )
2626
2727 onMount ( ( ) => {
28+ // Track all timeouts to ensure proper cleanup
29+ const timeouts : ReturnType < typeof setTimeout > [ ] = [ ]
30+
2831 function tick ( ) {
2932 if ( connected ( ) ) return
3033 if ( ! store . welcome ) {
3134 setStore ( "welcome" , true )
32- timeout = setTimeout ( ( ) => tick ( ) , 5000 )
35+ timeouts . push ( setTimeout ( ( ) => tick ( ) , 5000 ) )
3336 return
3437 }
3538
3639 if ( store . welcome ) {
3740 setStore ( "welcome" , false )
38- timeout = setTimeout ( ( ) => tick ( ) , 10_000 )
41+ timeouts . push ( setTimeout ( ( ) => tick ( ) , 10_000 ) )
3942 return
4043 }
4144 }
42- let timeout = setTimeout ( ( ) => tick ( ) , 10_000 )
45+ timeouts . push ( setTimeout ( ( ) => tick ( ) , 10_000 ) )
4346
4447 onCleanup ( ( ) => {
45- clearTimeout ( timeout )
48+ timeouts . forEach ( clearTimeout )
4649 } )
4750 } )
4851
You can’t perform that action at this time.
0 commit comments