Fix #745: add option to prevent screensaver on Now Playing page

This commit is contained in:
Drew Weymouth
2025-11-10 08:12:46 -08:00
parent 828b5ffc56
commit 8b73765a7d
5 changed files with 51 additions and 24 deletions
+6 -1
View File
@@ -17,6 +17,8 @@ type Router struct {
Controller *controller.Controller
Nav NavigationHandler
widgetPool *util.WidgetPool
OnNavigateTo func(controller.Route)
}
func NewRouter(app *backend.App, controller *controller.Controller, nav NavigationHandler) Router {
@@ -63,8 +65,11 @@ func (r Router) CreatePage(rte controller.Route) Page {
return nil
}
func (r Router) NavigateTo(rte controller.Route) {
func (r *Router) NavigateTo(rte controller.Route) {
if rte != r.Nav.CurrentPage() {
r.Nav.SetPage(r.CreatePage(rte))
}
if r.OnNavigateTo != nil {
r.OnNavigateTo(rte)
}
}