Skip to content

Commit

Permalink
Use dark theme as initial theme if the user agent prefers dark mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Oct 13, 2019
1 parent 88a02ed commit b012f3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/config.ts
Expand Up @@ -30,6 +30,7 @@ export default {
'vi-VN': 'Vietnamese',
},
query_history_depth: isElectron ? 50 : 7,
defaultTheme: 'matchMedia' in window && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',
themes: ['light', 'dark'],
isTranslateMode,
isWebApp: window['__ALTAIR_WEB_APP__'],
Expand Down
2 changes: 1 addition & 1 deletion src/app/reducers/settings/settings.ts
Expand Up @@ -71,7 +71,7 @@ export interface State {
}

const initialState: State = {
theme: 'light',
theme: <SettingsTheme>config.defaultTheme,
language: <SettingsLanguage>config.default_language,
addQueryDepthLimit: config.add_query_depth_limit,
tabSize: config.tab_size,
Expand Down

0 comments on commit b012f3d

Please sign in to comment.