From a433d22ba30217a4a23285244d07ad01e36ff3c3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 6 Feb 2023 16:09:25 -0600 Subject: [PATCH] Account: don't calculate max-width unnecessarily --- app/soapbox/components/account.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 7ee623586..7e8ffce0c 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -165,7 +165,9 @@ const Account = ({ const actionWidth = actionRef.current?.clientWidth || 0; if (overflowRef.current) { - style.maxWidth = Math.max(0, overflowRef.current.clientWidth - 30 - avatarSize - actionWidth); + if (action && withRelationship && typeof overflowRef.current.style.maxWidth !== 'number') { + style.maxWidth = Math.max(0, overflowRef.current.clientWidth - 30 - avatarSize - actionWidth); + } } else { style.visibility = 'hidden'; }