mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-07 18:31:33 +01:00
update isUserOnDarkTheme to return correct theme when use_system_theme is true
Signed-off-by: Germain <germain@grabyo.com>
This commit is contained in:
parent
a794bfdd3e
commit
bce88efa4f
@ -103,11 +103,15 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||
};
|
||||
|
||||
private isUserOnDarkTheme(): boolean {
|
||||
const theme = SettingsStore.getValue("theme");
|
||||
if (theme.startsWith("custom-")) {
|
||||
return getCustomTheme(theme.substring("custom-".length)).is_dark;
|
||||
if (SettingsStore.getValue("use_system_theme")) {
|
||||
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
} else {
|
||||
const theme = SettingsStore.getValue("theme");
|
||||
if (theme.startsWith("custom-")) {
|
||||
return getCustomTheme(theme.substring("custom-".length)).is_dark;
|
||||
}
|
||||
return theme === "dark";
|
||||
}
|
||||
return theme === "dark";
|
||||
}
|
||||
|
||||
private onProfileUpdate = async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user