From 618cc32a17f94d7caca5fab927d0a12207c69ce7 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 20 Mar 2021 23:32:32 +0000 Subject: [PATCH] hide updates from settings when disabled at build-time --- api.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api.go b/api.go index 3627a28..926188a 100644 --- a/api.go +++ b/api.go @@ -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)