perf: set the default value of the theme to "Auto"
This commit is contained in:
parent
484e6a5f6b
commit
94bcbdfe13
|
@ -30,7 +30,7 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
*/
|
||||
state: () => ({
|
||||
general: {
|
||||
theme: 'light',
|
||||
theme: 'auto',
|
||||
language: 'en',
|
||||
font: '',
|
||||
fontSize: 14,
|
||||
|
@ -134,14 +134,11 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
|
||||
isDark() {
|
||||
const th = get(this.general, 'theme', 'auto')
|
||||
if (th === 'auto') {
|
||||
if (osTheme.value === 'dark') {
|
||||
return true
|
||||
if (th !== 'auto') {
|
||||
return th === 'dark'
|
||||
} else {
|
||||
return osTheme.value === 'dark'
|
||||
}
|
||||
} else if (th === 'dark') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
||||
autoCheckUpdate() {
|
||||
|
|
Loading…
Reference in New Issue