mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-01 13:51:06 +08:00
fix theme
This commit is contained in:
@@ -98,18 +98,18 @@ async function fetchThemeConfig() {
|
||||
return null
|
||||
}
|
||||
|
||||
// 设置主题
|
||||
// 生效主题
|
||||
async function setTheme() {
|
||||
let themeValue = await fetchThemeConfig() || localStorage.getItem('theme') || 'light'
|
||||
let themeValue = (await fetchThemeConfig()) || localStorage.getItem('theme') || 'light'
|
||||
const autoTheme = checkPrefersColorSchemeIsDark() ? 'dark' : 'light'
|
||||
globalTheme.name.value = themeValue === 'auto' ? autoTheme : themeValue
|
||||
// 修改载入时背景色
|
||||
localStorage.setItem('materio-initial-loader-bg', globalTheme.current.value.colors.background)
|
||||
// 存储主题到本地
|
||||
localStorage.setItem('theme', themeValue)
|
||||
localStorage.setItem('materio-initial-loader-bg', globalTheme.current.value.colors.background)
|
||||
}
|
||||
|
||||
async function afterLogin() {
|
||||
// 主题配置
|
||||
// 生效主题配置
|
||||
await setTheme()
|
||||
// 尝试加载用户监控面板配置(本地无配置时才加载)
|
||||
await tryLoadDashboardConfig()
|
||||
|
||||
Reference in New Issue
Block a user