mirror of
https://github.com/fmhy/edit.git
synced 2026-01-11 10:56:16 +00:00
fix auto theme switch (#4422)
* fix auto theme switch * removed redundant timeout
This commit is contained in:
@@ -68,6 +68,9 @@ export class ThemeHandler {
|
||||
if (!localStorage.getItem(STORAGE_KEY_MODE)) {
|
||||
this.state.value.currentMode = e.matches ? 'dark' : 'light'
|
||||
this.applyTheme()
|
||||
}
|
||||
else {
|
||||
this.applyTheme()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -380,7 +383,7 @@ export function useTheme() {
|
||||
|
||||
onMounted(() => {
|
||||
// Ensure theme is applied on mount
|
||||
handler.setMode(handler.getMode())
|
||||
handler.applyTheme()
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user