You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-18 09:22:18 +03: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:
@ -103,12 +103,16 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private isUserOnDarkTheme(): boolean {
|
private isUserOnDarkTheme(): boolean {
|
||||||
|
if (SettingsStore.getValue("use_system_theme")) {
|
||||||
|
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||||
|
} else {
|
||||||
const theme = SettingsStore.getValue("theme");
|
const theme = SettingsStore.getValue("theme");
|
||||||
if (theme.startsWith("custom-")) {
|
if (theme.startsWith("custom-")) {
|
||||||
return getCustomTheme(theme.substring("custom-".length)).is_dark;
|
return getCustomTheme(theme.substring("custom-".length)).is_dark;
|
||||||
}
|
}
|
||||||
return theme === "dark";
|
return theme === "dark";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private onProfileUpdate = async () => {
|
private onProfileUpdate = async () => {
|
||||||
// the store triggered an update, so force a layout update. We don't
|
// the store triggered an update, so force a layout update. We don't
|
||||||
|
Reference in New Issue
Block a user