File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ function App() {
142
142
143
143
useEffect ( ( ) => {
144
144
const updateTheme = ( ) => {
145
- const isDark = localStorage . theme === 'dark' || ( localStorage . theme === 'system' && window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ) ;
145
+ const isDark = localStorage . theme === 'dark' || ( ! localStorage . theme && window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ) ;
146
146
setIsDark ( isDark ) ;
147
147
}
148
148
updateTheme ( ) ;
Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ export default function Preferences() {
58
58
setUseDesktopIde ( value ) ;
59
59
}
60
60
61
- const [ theme , setTheme ] = useState < Theme > ( localStorage . theme || 'light ' ) ;
61
+ const [ theme , setTheme ] = useState < Theme > ( localStorage . theme || 'system ' ) ;
62
62
const actuallySetTheme = ( theme : Theme ) => {
63
- if ( theme === 'dark' || theme === 'system ' ) {
63
+ if ( theme === 'dark' || theme === 'light ' ) {
64
64
localStorage . theme = theme ;
65
65
} else {
66
66
localStorage . removeItem ( 'theme' ) ;
67
67
}
68
- const isDark = localStorage . theme === 'dark' || ( localStorage . theme === 'system' && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) ;
68
+ const isDark = localStorage . theme === 'dark' || ( ! localStorage . theme && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) ;
69
69
setIsDark ( isDark ) ;
70
70
setTheme ( theme ) ;
71
71
}
You can’t perform that action at this time.
0 commit comments