Fix theme: load config before theme init, prevent flash on navigation

Theme init was running before config loaded, so admin theme settings
were ignored (config was null). Now: init once immediately (from cookie
or fallback), load config, init again with admin defaults. Theme
persists correctly across all routes including /admin.
This commit is contained in:
xpltd 2026-03-22 16:09:43 -05:00
parent 02c5e7bc1f
commit 1b5f24f796

View file

@ -13,8 +13,11 @@ const themeStore = useThemeStore()
const { connect } = useSSE()
onMounted(async () => {
// Apply theme from cookie immediately to prevent flash-of-wrong-theme
themeStore.init()
// Then load server config and re-apply with admin defaults
await configStore.loadConfig()
themeStore.init()
await themeStore.loadCustomThemes()
await downloadsStore.fetchJobs()
connect()