From f0181d92cd76d5973d58eb580650daec85d034de Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sun, 25 Sep 2022 21:20:32 +0800 Subject: [PATCH] fix: keep type of setting item is correct --- internal/bootstrap/data/setting.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/bootstrap/data/setting.go b/internal/bootstrap/data/setting.go index 05cc9b77823..d7028f8e383 100644 --- a/internal/bootstrap/data/setting.go +++ b/internal/bootstrap/data/setting.go @@ -43,7 +43,8 @@ func initSettings() { } else if err != nil { log.Fatalf("failed get setting: %+v", err) } else { - err = db.SaveSettingItem(*stored) + v.Value = stored.Value + err = db.SaveSettingItem(v) if err != nil { log.Fatalf("failed resave setting: %+v", err) } @@ -77,7 +78,7 @@ func InitialSettings() []model.SettingItem { {Key: "pagination_type", Value: "all", Type: conf.TypeSelect, Options: "all,pagination,load_more,auto_load_more", Group: model.SITE}, {Key: "default_page_size", Value: "30", Type: conf.TypeNumber, Group: model.SITE}, // style settings - {Key: conf.Logo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE}, + {Key: conf.Logo, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeText, Group: model.STYLE}, {Key: conf.Favicon, Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", Type: conf.TypeString, Group: model.STYLE}, {Key: conf.MainColor, Value: "#1890ff", Type: conf.TypeString, Group: model.STYLE}, {Key: "home_icon", Value: "🏠", Type: conf.TypeString, Group: model.STYLE},