fix: stale display outputs leaking between pages in web UI

Bug: when the StreamDeck was on a non-main page (e.g. dashboard) and the
web UI was opened in a private browser tab, the frontend defaulted to the
first page in config while display outputs from the other page were still
applied to keys sharing the same index.

Fix 1 (backend): send the current active page via SSE immediately on new
client connection so the frontend knows the correct page from the start.

Fix 2 (frontend): only apply display output text/background to keys that
have a display config, preventing cross-page leakage.
This commit is contained in:
totmin
2026-07-12 11:27:10 +07:00
parent 3709926c4a
commit f20a499c0f
2 changed files with 11 additions and 3 deletions
+8
View File
@@ -172,6 +172,14 @@ func (s *WebServer) handleSSE(w http.ResponseWriter, r *http.Request) {
s.sseClients[ch] = struct{}{}
s.sseMu.Unlock()
s.mu.RLock()
if s.pm != nil {
if active := s.pm.ActivePageName(); active != "" {
ch <- active
}
}
s.mu.RUnlock()
notify := r.Context().Done()
go func() {
<-notify