Group pending messages

This commit is contained in:
Eric Bailey
2024-05-15 10:54:45 -05:00
parent 0e04730ae2
commit f70d9e1b94
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -37,6 +37,11 @@ let MessageItem = ({
nextMessage.sender?.did === currentAccount?.did
const isLastInGroup = useMemo(() => {
// if this message is pending, it means the next message is pending too
if (isPending && nextMessage) {
return false
}
// if the next message is from a different sender, then it's the last in the group
if (isFromSelf ? !isNextFromSelf : isNextFromSelf) {
return true
@@ -54,7 +59,7 @@ let MessageItem = ({
}
return true
}, [message, nextMessage, isFromSelf, isNextFromSelf])
}, [message, nextMessage, isFromSelf, isNextFromSelf, isPending])
const lastInGroupRef = useRef(isLastInGroup)
if (lastInGroupRef.current !== isLastInGroup) {
+1
View File
@@ -945,6 +945,7 @@ export class Convo {
key: m.id,
message: {
...m.message,
$type: 'chat.bsky.convo.defs#messageView',
id: nanoid(),
rev: '__fake__',
sentAt: new Date().toISOString(),