From b60fdfced48065ee0b812c6e8bf435bc53e5992b Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sun, 9 Nov 2025 18:52:52 +0100 Subject: [PATCH] refresh 3 --- apps/ui/templates/dashboard.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/ui/templates/dashboard.html b/apps/ui/templates/dashboard.html index 5d123fb..6948355 100644 --- a/apps/ui/templates/dashboard.html +++ b/apps/ui/templates/dashboard.html @@ -726,6 +726,15 @@ }); }); + // Clean up SSE connection before page unload + window.addEventListener('beforeunload', () => { + if (eventSource) { + console.log('Closing SSE connection before unload'); + eventSource.close(); + eventSource = null; + } + }); + // API_BASE injected from backend (supports Docker/K8s environments) window.API_BASE = '{{ api_base }}';