fix: theme preference bug

This commit is contained in:
0xJacky 2023-01-07 12:21:50 +08:00
parent f2b2ef2560
commit 1aa8334633
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
3 changed files with 4 additions and 1 deletions

View file

@ -21,6 +21,7 @@ declare module '@vue/runtime-core' {
AFormItem: typeof import('ant-design-vue/es')['FormItem']
AInput: typeof import('ant-design-vue/es')['Input']
AInputGroup: typeof import('ant-design-vue/es')['InputGroup']
AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
ALayout: typeof import('ant-design-vue/es')['Layout']
ALayoutContent: typeof import('ant-design-vue/es')['LayoutContent']

View file

@ -16,6 +16,8 @@ const callback = (media: { matches: any; }) => {
dark_mode(false)
settings.set_theme('auto')
}
} else {
dark_mode(settings.preference_theme === 'dark')
}
}

View file

@ -10,7 +10,7 @@ import {message} from 'ant-design-vue'
const {$gettext} = useGettext()
const settingsStore = useSettingsStore()
const theme = ref('auto')
const theme = ref(settingsStore.theme)
const data = ref({
server: {
http_port: 9000,