From 90c26e053c3d122fc9fa72705ca5bd6bb9917c22 Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Thu, 8 Jan 2026 11:51:05 +0100 Subject: [PATCH] Config UI: fix interval change feedback (#26523) --- server/http.go | 2 +- server/http_global_settings_handler.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/http.go b/server/http.go index 1579deb67..940e3ebf1 100644 --- a/server/http.go +++ b/server/http.go @@ -291,7 +291,7 @@ func (s *HTTPd) RegisterSystemHandler(site *core.Site, pub publisher, cache *uti "deletedevice": {"DELETE", "/devices/{class:[a-z]+}/{id:[0-9.]+}", deleteDeviceHandler(site)}, "testconfig": {"POST", "/test/{class:[a-z]+}", testConfigHandler}, "testmerged": {"POST", "/test/{class:[a-z]+}/merge/{id:[0-9.]+}", testConfigHandler}, - "interval": {"POST", "/interval/{value:[0-9.]+}", settingsSetDurationHandler(keys.Interval)}, + "interval": {"POST", "/interval/{value:[0-9.]+}", settingsSetDurationHandler(keys.Interval, pub)}, "updatesponsortoken": {"POST", "/sponsortoken", updateSponsortokenHandler(pub)}, "deletesponsortoken": {"DELETE", "/sponsortoken", deleteSponsorTokenHandler(pub)}, } diff --git a/server/http_global_settings_handler.go b/server/http_global_settings_handler.go index 4d91ff78e..316017508 100644 --- a/server/http_global_settings_handler.go +++ b/server/http_global_settings_handler.go @@ -35,7 +35,7 @@ func settingsDeleteHandler(key string) http.HandlerFunc { } } -func settingsSetDurationHandler(key string) http.HandlerFunc { +func settingsSetDurationHandler(key string, pub publisher) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) @@ -48,6 +48,8 @@ func settingsSetDurationHandler(key string) http.HandlerFunc { settings.SetInt(key, int64(time.Second*time.Duration(val))) setConfigDirty() + pub(key, val) + jsonWrite(w, val) } }