Account: don't calculate max-width unnecessarily

This commit is contained in:
Alex Gleason 2023-02-06 16:09:25 -06:00
parent ab8d162f03
commit a433d22ba3
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 1 deletions

View File

@ -165,7 +165,9 @@ const Account = ({
const actionWidth = actionRef.current?.clientWidth || 0;
if (overflowRef.current) {
if (action && withRelationship && typeof overflowRef.current.style.maxWidth !== 'number') {
style.maxWidth = Math.max(0, overflowRef.current.clientWidth - 30 - avatarSize - actionWidth);
}
} else {
style.visibility = 'hidden';
}