fix: restart periodic keys on device page switch, render display output in UI grid
- daemon.go: call stopPeriodicKeys/startPeriodicKeys after page switch from device gesture and auto-switch (was missing, causing goroutines to never restart for the correct page) - app.js: forward display output background to /api/render preview URL - index.html: show preview image and text from display output when key has no configured background/icon/label
This commit is contained in:
@@ -114,8 +114,9 @@ func Run(ctx context.Context, cfg *config.Config, opts RunOptions) error {
|
||||
if a.Type == "page" {
|
||||
asm.NotifyManualPage(a.Page)
|
||||
}
|
||||
for _, pm := range pageMgrs[1:] {
|
||||
pm.ActivatePage(newPage)
|
||||
for _, pm := range pageMgrs {
|
||||
pm.stopPeriodicKeys()
|
||||
pm.startPeriodicKeys()
|
||||
}
|
||||
web.BroadcastPageChange(newPage)
|
||||
}
|
||||
@@ -195,6 +196,7 @@ func Run(ctx context.Context, cfg *config.Config, opts RunOptions) error {
|
||||
if err := pm.ActivatePage(page); err != nil {
|
||||
slog.Warn("auto-switch: activate page", "error", err)
|
||||
}
|
||||
pm.stopPeriodicKeys()
|
||||
pm.startPeriodicKeys()
|
||||
}
|
||||
web.BroadcastPageChange(page)
|
||||
|
||||
Reference in New Issue
Block a user