v0.11.27 message bug fixes
This commit is contained in:
@@ -296,19 +296,28 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
</button>
|
||||
)}
|
||||
|
||||
{messages.map((msg, i) => (
|
||||
<Message
|
||||
key={msg.id}
|
||||
message={msg}
|
||||
prevMessage={messages[i - 1]}
|
||||
currentUser={currentUser}
|
||||
onReply={handleReply}
|
||||
onDelete={handleDelete}
|
||||
onReact={handleReact}
|
||||
onDirectMessage={handleDirectMessage}
|
||||
isDirect={isDirect}
|
||||
onlineUserIds={onlineUserIds} />
|
||||
))}
|
||||
{messages.map((msg, i) => {
|
||||
// Skip deleted entries when looking for the effective previous message.
|
||||
// Deleted messages render null, so they must not affect date separators
|
||||
// or avatar-grouping for the messages that follow them.
|
||||
let effectivePrev = null;
|
||||
for (let j = i - 1; j >= 0; j--) {
|
||||
if (!messages[j].is_deleted) { effectivePrev = messages[j]; break; }
|
||||
}
|
||||
return (
|
||||
<Message
|
||||
key={msg.id}
|
||||
message={msg}
|
||||
prevMessage={effectivePrev}
|
||||
currentUser={currentUser}
|
||||
onReply={handleReply}
|
||||
onDelete={handleDelete}
|
||||
onReact={handleReact}
|
||||
onDirectMessage={handleDirectMessage}
|
||||
isDirect={isDirect}
|
||||
onlineUserIds={onlineUserIds} />
|
||||
);
|
||||
})}
|
||||
|
||||
{typing.length > 0 && (
|
||||
<div className="typing-indicator">
|
||||
|
||||
Reference in New Issue
Block a user