@@ -44,12 +44,8 @@ const daemon = {
4444 fetch ( '/api/daemon/status' )
4545 . then ( ( response ) => response . json ( ) )
4646 . then ( async ( data ) => {
47- let previousState = daemon . currentStatus . state ;
4847 daemon . currentStatus = data ;
49-
50- if ( previousState !== daemon . currentStatus . state ) {
51- await daemon . updateUI ( ) ;
52- }
48+ await daemon . updateUI ( ) ;
5349 } )
5450 . catch ( ( error ) => {
5551 console . error ( 'Error fetching daemon status:' , error ) ;
@@ -65,7 +61,7 @@ const daemon = {
6561
6662 let currentState = daemon . currentStatus . state ;
6763
68- if ( currentState === initialState || currentState === "starting" || currentState === "stopping" ) {
64+ if ( currentState !== "error" && ( currentState === initialState || currentState === "starting" || currentState === "stopping" ) ) {
6965 setTimeout ( ( ) => {
7066 daemon . checkStatusUpdate ( initialState ) ;
7167 } , 500 ) ;
@@ -128,11 +124,12 @@ const daemon = {
128124 backendStatusText . textContent = 'Stopped' ;
129125 }
130126 else if ( daemonState === 'error' ) {
131- // daemonStatusAnim.setAttribute('data', '/static/assets/reachy-mini-ko-animation.svg');
132127 daemonStatusAnim . setAttribute ( 'data' , '/static/assets/no-wifi-cartoon.svg' ) ;
133128 toggleDaemonSwitch . checked = false ;
134129 backendStatusIcon . classList . add ( 'bg-red-500' ) ;
135130 backendStatusText . textContent = 'Error occurred' ;
131+
132+ notificationCenter . showError ( daemon . currentStatus . error ) ;
136133 }
137134
138135 await daemon . updateToggle ( ) ;
0 commit comments