Don't hammer on the layout engine with avatar updates for the background
Changing the property on every render of the left panel (which is basically all the time) is super bad on the GPU and for our CPU. We should only do that when something changes.
This commit is contained in:
parent
cbe4f04cd7
commit
0a846cb1b5
3 changed files with 26 additions and 3 deletions
|
@ -306,9 +306,6 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
|||
|
||||
public render() {
|
||||
const avatarSize = 32; // should match border-radius of the avatar
|
||||
const {body} = document;
|
||||
const avatarUrl = OwnProfileStore.instance.getHttpAvatarUrl(avatarSize);
|
||||
body.style.setProperty("--avatar-url", `url('${avatarUrl}')`);
|
||||
|
||||
let name = <span className="mx_UserMenu_userName">{OwnProfileStore.instance.displayName}</span>;
|
||||
let buttons = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue