diff --git a/static/index.html b/static/index.html index 8c0b16c..d3a1069 100644 --- a/static/index.html +++ b/static/index.html @@ -1171,11 +1171,13 @@ function renderTimeSeriesChart(timeSeriesData, chart, minutes) { } }; - source.onerror = async (err) => { - console.error("SSE connection error. Retrying...", err); - source.close(); - await showApiKeyModal("Enter the NOMYO Router API key to view live usage."); - loadUsage(); + source.onerror = (err) => { + // EventSource auto-reconnects on transient drops as long as we + // don't close it. Don't treat a dropped stream as an auth failure: + // auth prompting is handled by loadEndpoints()/authedFetch() on the + // REST endpoints. A genuine 401 closes the stream permanently here + // (no reconnect loop), and the REST path surfaces the modal. + console.error("SSE connection error; awaiting auto-reconnect.", err); }; window.addEventListener("beforeunload", () => source.close()); }