Skip to content

Commit

Permalink
Use globalThis.setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Dec 26, 2023
1 parent a60235f commit 83466bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions themes/default/assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const initHandler = (document, element) => {
const toggleTheme = (document) => {
const colorScheme = activeColorScheme === 'dark' ? 'light' : 'dark'
document.querySelector('html').classList.add('theme-transistion')
setTimeout(() => {
globalThis.setTimeout(() => {
setTheme(document, colorScheme)
}, 0)
setTimeout(() => {
globalThis.setTimeout(() => {
document.querySelector('html').classList.remove('theme-transistion')
}, 2000)
}
Expand Down

0 comments on commit 83466bc

Please sign in to comment.