mirror of
https://github.com/fmhy/edit.git
synced 2026-01-12 23:11:06 +11:00
removed redundant timeout
This commit is contained in:
parent
2f2aff8614
commit
be79cf4652
1 changed files with 7 additions and 9 deletions
|
|
@ -65,7 +65,6 @@ export class ThemeHandler {
|
|||
|
||||
// Listen for system theme changes (only if user hasn't set a preference)
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
||||
setTimeout(() => {
|
||||
if (!localStorage.getItem(STORAGE_KEY_MODE)) {
|
||||
this.state.value.currentMode = e.matches ? 'dark' : 'light'
|
||||
this.applyTheme()
|
||||
|
|
@ -73,7 +72,6 @@ export class ThemeHandler {
|
|||
else {
|
||||
this.applyTheme()
|
||||
}
|
||||
}, 10)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue