Files
pai-companion-voice-widget-…/www/app.js
nonna add0f803cd Fix status flicker during WebSocket reconnect loop
connect() was unconditionally calling setStatus('connecting', ...) at the
top of each attempt, causing a visible flicker over "Disconnected —
retrying..." every 3 seconds during the retry loop.

Fix: add everConnected flag (was missing from Neutralino version);
connect() only shows "Connecting..." on the first attempt. onclose now
uses everConnected instead of _hadError to determine state. onerror no
longer sets its own status — onclose is the sole status updater on
disconnect, eliminating a second flicker source. everConnected is reset
on Save so pointing at a new server shows "Connecting..." cleanly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 01:19:51 +00:00

10 KiB