From 258bdae6e177d794c373b8076190ea0ec08a1cf0 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 6 Nov 2025 11:36:56 +0100 Subject: [PATCH] User Note: Fix calc `isCollapsible` (#6443) --- src/components/common/profile/ChatExtra.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/common/profile/ChatExtra.tsx b/src/components/common/profile/ChatExtra.tsx index 71f7a9d11..b9283bdac 100644 --- a/src/components/common/profile/ChatExtra.tsx +++ b/src/components/common/profile/ChatExtra.tsx @@ -165,11 +165,18 @@ const ChatExtra = ({ const noteTextRef = useRef(); + const shouldRenderNote = Boolean(note); + const { isCollapsed: isNoteCollapsed, isCollapsible: isNoteCollapsible, setIsCollapsed: setIsNoteCollapsed, - } = useCollapsibleLines(noteTextRef, MAX_LINES, undefined); + } = useCollapsibleLines( + noteTextRef, + MAX_LINES, + undefined, + !shouldRenderNote, + ); useEffectWithPrevDeps(([prevPeerId]) => { if (!peerId || prevPeerId === peerId) return; @@ -481,7 +488,7 @@ const ChatExtra = ({ {oldLang('BusinessProfileLocation')} )} - {note && ( + {shouldRenderNote && (