Skip to content

Commit

Permalink
Merge pull request #84 from Quiddlee/fix/theme
Browse files Browse the repository at this point in the history
fix: eslint warn
  • Loading branch information
Quiddlee authored Jan 7, 2024
2 parents 47991a4 + 64fedd9 commit ecf3efe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/layouts/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const MainLayout = () => {
useEffect(() => {
if (!mainRef.current) return;

const isLight = localStorage.getItem(LocalStorageKeys.LIGHT_THEME);

const isLight =
localStorage.getItem(LocalStorageKeys.LIGHT_THEME) ||
(window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches);
if (isLight || !isWelcome) {
mainRef.current.style.backgroundColor = '';
} else if (!isLight && isWelcome) {
Expand Down

0 comments on commit ecf3efe

Please sign in to comment.