1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

hide updates from settings when disabled at build-time

This commit is contained in:
Harvey Tindall 2021-03-20 23:32:32 +00:00
parent a8bf670697
commit 618cc32a17
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

9
api.go
View File

@ -1246,6 +1246,15 @@ func (app *appContext) GetConfig(gc *gin.Context) {
el := resp.Sections["email"].Settings["language"]
el.Options = emailOptions
el.Value = app.config.Section("email").Key("language").MustString("en-us")
if updater == "" {
delete(resp.Sections, "updates")
for i, v := range resp.Order {
if v == "updates" {
resp.Order = append(resp.Order[:i], resp.Order[i+1:]...)
break
}
}
}
for sectName, section := range resp.Sections {
for settingName, setting := range section.Settings {
val := app.config.Section(sectName).Key(settingName)