1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-12-02 21:22:41 +03:00
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2020-10-15 16:57:07 +01:00
parent efad42439e
commit 3e548bbc94

View File

@@ -121,10 +121,9 @@ export default class LeftPanel extends React.Component<IProps, IState> {
}
const avatarUrlProp = `url(${avatarUrl})`;
const existingValue = document.body.style.getPropertyValue("--avatar-url");
if (!avatarUrl && existingValue) {
if (!avatarUrl) {
document.body.style.removeProperty("--avatar-url");
} else if (avatarUrl && existingValue !== avatarUrlProp) {
} else if (avatarUrl && document.body.style.getPropertyValue("--avatar-url") !== avatarUrlProp) {
document.body.style.setProperty("--avatar-url", avatarUrlProp);
}
};