Fix stale alerts for deleted agents on command deck
This commit is contained in:
@@ -108,6 +108,9 @@ export function WebSocketProvider({ children }: { children: React.ReactNode }) {
|
||||
case 'agent_deleted': {
|
||||
const { agent_id } = msg.payload as { agent_id: string };
|
||||
setAgents((prev) => prev.filter((a) => a.id !== agent_id));
|
||||
// Also purge any cached alerts for this agent so the dashboard
|
||||
// alert banner stops showing errors for machines that no longer exist.
|
||||
setFleetAlerts((prev) => prev.filter((a) => a.agent_id !== agent_id));
|
||||
break;
|
||||
}
|
||||
case 'stats_update': {
|
||||
|
||||
Reference in New Issue
Block a user