mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix: set theme (#111)
This commit is contained in:
parent
0076ea9129
commit
90bda2e309
1 changed files with 7 additions and 7 deletions
|
@ -11,13 +11,13 @@ export const InitializeGlobalContext = () => {
|
|||
SettingsContext.set(JSON.parse(settings_ctx));
|
||||
} else {
|
||||
// Only check for light theme, otherwise dark theme is the default
|
||||
const userMedia = window.matchMedia("(prefers-color-scheme: light)");
|
||||
if (userMedia.matches) {
|
||||
SettingsContext.set((state) => ({
|
||||
...state,
|
||||
darkTheme: false
|
||||
}));
|
||||
}
|
||||
SettingsContext.set((state) => ({
|
||||
...state,
|
||||
darkTheme: !(
|
||||
window.matchMedia !== undefined &&
|
||||
window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue