diff --git a/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx b/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx index f2b06468ac8d9f1dd5699684bd7a467f3fd6566a..1d123e7b4c65aefa11923543f9c7354dbb5af2ea 100644 --- a/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/chat/message-list/component.jsx @@ -46,6 +46,13 @@ class MessageList extends Component { this.cache = new CellMeasurerCache({ fixedWidth: true, minHeight: 18, + keyMapper: (rowIndex, columnIndex) => { + const { messages } = this.props; + const message = messages[rowIndex]; + const key = message.id; + const contentCount = message.content.length; + return `${key}-${contentCount}`; + }, }); this.userScrolledBack = false; @@ -190,9 +197,15 @@ class MessageList extends Component { const message = messages[index]; // it's to get an accurate size of the welcome message because it changes after initial render - - if (message.sender === null && !this.systemMessagesResized[index]) { - setTimeout(() => this.resizeRow(index), 500); + if (message.id.startsWith('welcome-msg') && !this.systemMessagesResized[index]) { + [500, 1000, 2000, 3000, 4000, 5000].forEach((i)=>{ + setTimeout(() => { + if (this.listRef) { + this.cache.clear(index); + this.listRef.recomputeRowHeights(index); + } + }, i); + }); this.systemMessagesResized[index] = true; }