Skip to content

Commit

Permalink
only apply saved theme when dom content has loaded
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L. <[email protected]>
  • Loading branch information
szaimen committed Oct 18, 2024
1 parent 0e960b8 commit 9bf38d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/public/toggle-dark-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ function applySavedTheme() {
}
}

// Immediately apply the saved theme
applySavedTheme();
// Apply theme when the page loads
document.addEventListener('DOMContentLoaded', applySavedTheme);

0 comments on commit 9bf38d2

Please sign in to comment.