diff --git a/src/control/engine.rs b/src/control/engine.rs index 4a77193..e547915 100644 --- a/src/control/engine.rs +++ b/src/control/engine.rs @@ -94,7 +94,12 @@ async fn unit_task(state: AppState, store: Arc, unit_id: Uu if !runtime.auto_enabled || runtime.fault_locked || runtime.comm_locked { tokio::select! { _ = fault_tick.tick() => {} - _ = notify.notified() => {} + _ = notify.notified() => { + // Push fresh runtime immediately so the frontend reflects the change + // (e.g. auto_enabled toggled) without waiting for the next state transition. + let runtime = store.get_or_init(unit_id).await; + push_ws(&state, &runtime).await; + } } continue; }