Always load user's theme from API if available, and update the localStorage cache. Previously in various situations the old cached value was being used instead, leading to inconsistent theming or wrong themeselector readout.

This commit is contained in:
Leo Vasanko
2026-02-18 18:35:41 +00:00
parent 5fac0b198e
commit 3a4db0cb12
9 changed files with 15 additions and 5 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
// Early theme for restricted app - first URL param wins, then localStorage
// Early theme for restricted app - user preference (localStorage) wins, then URL param
import { applyTheme, getCachedTheme } from '@/utils/theme.js'
function getTheme() {
const params = new URLSearchParams(location.hash.slice(1))
return params.get('theme') || getCachedTheme() || ''
return getCachedTheme() || params.get('theme') || ''
}
// Apply theme class to document root