From e0b6eb3a593abb29b3b123ad5f8fa1fc1b939763 Mon Sep 17 00:00:00 2001 From: Micah-Zheng <102610064+Micah-Zheng@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:44:44 +0800 Subject: [PATCH] fix: sync theme to runtime when loaded from database (#4518) The handleConfigUpdate function updates themeSettings.Frontend from DB but never calls syncThemeToCommon(), so common.GetTheme() always returns the hardcoded init value "classic" regardless of the DB setting. This causes the web router to serve the classic frontend even when the DB has theme.frontend=default. Add post-processing hook for the "theme" config to call UpdateAndSyncTheme(), consistent with how performance_setting and billing_setting already handle their sync. Co-authored-by: Micah Zheng --- model/option.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/option.go b/model/option.go index 871f73a2..e0a3048d 100644 --- a/model/option.go +++ b/model/option.go @@ -581,6 +581,8 @@ func handleConfigUpdate(key, value string) bool { } else if configName == "billing_setting" { InvalidatePricingCache() ratio_setting.InvalidateExposedDataCache() + } else if configName == "theme" { + system_setting.UpdateAndSyncTheme() } return true // 已处理