You've already forked AstralRinth
forked from didirus/AstralRinth
Fix system theme not respecting preferred dark theme. (#1673)
This commit is contained in:
@@ -2,6 +2,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
||||
await useAuth()
|
||||
await useUser()
|
||||
const themeStore = useTheme()
|
||||
const cosmetics = useCosmetics()
|
||||
|
||||
nuxtApp.hook('app:mounted', () => {
|
||||
if (process.client && themeStore.value.preference === 'system') {
|
||||
@@ -12,7 +13,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
|
||||
if (e.matches) {
|
||||
updateTheme('light')
|
||||
} else {
|
||||
updateTheme('dark')
|
||||
updateTheme(cosmetics.value.preferredDarkTheme ?? 'dark')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user