mirror of
https://github.com/xpltdco/media-rip.git
synced 2026-04-03 02:53:58 -06:00
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:
parent
02c5e7bc1f
commit
1b5f24f796
1 changed files with 3 additions and 0 deletions
|
|
@ -13,8 +13,11 @@ const themeStore = useThemeStore()
|
||||||
const { connect } = useSSE()
|
const { connect } = useSSE()
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// Apply theme from cookie immediately to prevent flash-of-wrong-theme
|
||||||
themeStore.init()
|
themeStore.init()
|
||||||
|
// Then load server config and re-apply with admin defaults
|
||||||
await configStore.loadConfig()
|
await configStore.loadConfig()
|
||||||
|
themeStore.init()
|
||||||
await themeStore.loadCustomThemes()
|
await themeStore.loadCustomThemes()
|
||||||
await downloadsStore.fetchJobs()
|
await downloadsStore.fetchJobs()
|
||||||
connect()
|
connect()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue