fixes the logic for when the last message is a message from a thread (#5129)

This commit is contained in:
Gleidson Daniel Silva 2023-08-17 18:49:05 -03:00 committed by GitHub
parent f5da42aae4
commit 65b409beb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 9 deletions

View File

@ -1307,15 +1307,14 @@ class RoomView extends React.Component<IRoomViewProps, IRoomViewState> {
}
let content = null;
if (item.t && MESSAGE_TYPE_ANY_LOAD.includes(item.t as MessageTypeLoad)) {
content = (
<LoadMore
rid={room.rid}
t={room.t as RoomType}
loaderId={item.id}
type={item.t}
runOnRender={item.t === MessageTypeLoad.MORE && !previousItem}
/>
);
const runOnRender = () => {
if (item.t === MessageTypeLoad.MORE) {
if (!previousItem) return true;
if (previousItem?.tmid) return true;
}
return false;
};
content = <LoadMore rid={room.rid} t={room.t as RoomType} loaderId={item.id} type={item.t} runOnRender={runOnRender()} />;
} else {
content = (
<Message