Merge pull request #5319 from matrix-org/t3chguy/fix/null-avatar
Fix background-image: url(null) for backdrop filter
This commit is contained in:
commit
0c87df4957
2 changed files with 5 additions and 2 deletions
|
@ -119,8 +119,11 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||
if (settingBgMxc) {
|
||||
avatarUrl = MatrixClientPeg.get().mxcUrlToHttp(settingBgMxc, avatarSize, avatarSize);
|
||||
}
|
||||
|
||||
const avatarUrlProp = `url(${avatarUrl})`;
|
||||
if (document.body.style.getPropertyValue("--avatar-url") !== avatarUrlProp) {
|
||||
if (!avatarUrl) {
|
||||
document.body.style.removeProperty("--avatar-url");
|
||||
} else if (document.body.style.getPropertyValue("--avatar-url") !== avatarUrlProp) {
|
||||
document.body.style.setProperty("--avatar-url", avatarUrlProp);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue