mirror of
https://github.com/gotson/komga.git
synced 2025-12-13 12:03:44 +01:00
19 lines
449 B
TypeScript
19 lines
449 B
TypeScript
import { useTheme } from 'vuetify'
|
|
import { useAppStore } from '@/stores/app'
|
|
|
|
export function useThemeWatcher() {
|
|
const appStore = useAppStore()
|
|
const theme = useTheme()
|
|
|
|
function updateTheme(selectedTheme: string) {
|
|
theme.change(selectedTheme)
|
|
}
|
|
|
|
watch(
|
|
() => appStore.theme,
|
|
(selectedTheme) => updateTheme(selectedTheme),
|
|
)
|
|
|
|
// trigger an update on startup to get the proper theme loaded
|
|
updateTheme(appStore.theme)
|
|
}
|