mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-08-01 02:11:15 -04:00
fix: make the runtime store authoritative for the announcement
Always reflect the stored announcement in config.json: expose it while live and clear it otherwise. A disabled announcement now clears the config output instead of falling back to a statically configured one, which removes the precedence ambiguity raised in review.
This commit is contained in:
@@ -156,11 +156,9 @@ func (p Web) getPayload() (payload []byte, err error) {
|
||||
// ensure that the server url has a trailing slash
|
||||
webConfig.Server = strings.TrimRight(webConfig.Server, "/") + "/"
|
||||
|
||||
// inject the runtime managed announcement banner; keep a statically configured one
|
||||
// (web.config.options.announcement) when nothing is stored
|
||||
if a := p.currentAnnouncement(); a != nil {
|
||||
webConfig.Options.Announcement = a
|
||||
}
|
||||
// the runtime store is authoritative for the announcement banner: expose it when live,
|
||||
// clear it otherwise
|
||||
webConfig.Options.Announcement = p.currentAnnouncement()
|
||||
|
||||
return json.Marshal(webConfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user