Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix leaked alerts activation event listener on unmount
rcourtman9cf6c98fca24
diff --git a/frontend-modern/src/stores/websocket.ts b/frontend-modern/src/stores/websocket.tsindex c754ba6222..bf391afda9 100644--- a/frontend-modern/src/stores/websocket.ts+++ b/frontend-modern/src/stores/websocket.ts@@ -164,11 +164,6 @@ export function createWebSocketStore(url: string) {let alertsEnabled = isAlertsActivationEnabled();let lastActiveAlertsPayload: Record<string, Alert> = {};- const handleAlertsActivation = (event: Event) => {- const detail = (event as CustomEvent<ActivationStateType | null>).detail;- alertsEnabled = detail === 'active';- applyActiveAlerts(alertsEnabled ? lastActiveAlertsPayload : {});- };const clearPendingAckTimeout = (alertIdentifier: string) => {const timeout = pendingAckTimeouts.get(alertIdentifier);@@ -708,7 +703,7 @@ export function createWebSocketStore(url: string) {window.clearTimeout(reconnectTimeout);window.clearInterval(heartbeatInterval);if (typeof window !== 'undefined') {- window.removeEventListener(ALERTS_ACTIVATION_EVENT, handleAlertsActivation);+ window.removeEventListener(ALERTS_ACTIVATION_EVENT, handleAlertsActivationEvent);}if (ws) {ws.close(1000, 'Component unmounting');