@@ -32,8 +32,8 @@ const App = observer(() => {
3232
3333 ws . onopen = ( ) => {
3434 console . log ( "Connected to file watcher" ) ;
35- state . isConnected = true ;
36- state . isLoading = true ; // Set loading when connection opens
35+ state . setConnected ( true ) ;
36+ state . setLoading ( true ) ; // Set loading when connection opens
3737 reconnectAttemptsRef . current = 0 ; // Reset reconnect attempts on successful connection
3838 } ;
3939
@@ -49,21 +49,21 @@ const App = observer(() => {
4949 console . log ( "initialize_logs" , rows ) ;
5050 state . upsertRows ( rows ) ;
5151 } else if ( update . type === "log" ) {
52- state . isLoading = true ; // Set loading for individual log updates
52+ state . setLoading ( true ) ; // Set loading for individual log updates
5353 const row : EvaluationRow = EvaluationRowSchema . parse ( update . row ) ;
5454 console . log ( "log" , row ) ;
5555 state . upsertRows ( [ row ] ) ;
5656 }
5757 } catch ( error ) {
5858 console . error ( "Failed to parse WebSocket message:" , error ) ;
59- state . isLoading = false ; // Clear loading state on error
59+ state . setLoading ( false ) ; // Clear loading state on error
6060 }
6161 } ;
6262
6363 ws . onclose = ( event ) => {
6464 console . log ( "Disconnected from file watcher" , event . code , event . reason ) ;
65- state . isConnected = false ;
66- state . isLoading = false ; // Clear loading state on disconnect
65+ state . setConnected ( false ) ;
66+ state . setLoading ( false ) ; // Clear loading state on disconnect
6767
6868 // Attempt to reconnect if not a normal closure
6969 if (
@@ -76,8 +76,8 @@ const App = observer(() => {
7676
7777 ws . onerror = ( error ) => {
7878 console . error ( "WebSocket error:" , error ) ;
79- state . isConnected = false ;
80- state . isLoading = false ; // Clear loading state on error
79+ state . setConnected ( false ) ;
80+ state . setLoading ( false ) ; // Clear loading state on error
8181 } ;
8282 } ;
8383
@@ -104,7 +104,7 @@ const App = observer(() => {
104104
105105 // Manual refresh handler
106106 const handleManualRefresh = ( ) => {
107- state . isLoading = true ; // Set loading when manually refreshing
107+ state . setLoading ( true ) ; // Set loading when manually refreshing
108108 if ( wsRef . current ) {
109109 try {
110110 wsRef . current . onclose = null ; // Prevent triggering reconnect logic
0 commit comments