User Note: Fix calc isCollapsible (#6443)
This commit is contained in:
parent
8bff844a5f
commit
258bdae6e1
@ -165,11 +165,18 @@ const ChatExtra = ({
|
||||
|
||||
const noteTextRef = useRef<HTMLDivElement>();
|
||||
|
||||
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 = ({
|
||||
<span className="subtitle">{oldLang('BusinessProfileLocation')}</span>
|
||||
</ListItem>
|
||||
)}
|
||||
{note && (
|
||||
{shouldRenderNote && (
|
||||
<ListItem
|
||||
icon="note"
|
||||
iconClassName={styles.noteListItemIcon}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user