Group pending messages
This commit is contained in:
@@ -37,6 +37,11 @@ let MessageItem = ({
|
|||||||
nextMessage.sender?.did === currentAccount?.did
|
nextMessage.sender?.did === currentAccount?.did
|
||||||
|
|
||||||
const isLastInGroup = useMemo(() => {
|
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 the next message is from a different sender, then it's the last in the group
|
||||||
if (isFromSelf ? !isNextFromSelf : isNextFromSelf) {
|
if (isFromSelf ? !isNextFromSelf : isNextFromSelf) {
|
||||||
return true
|
return true
|
||||||
@@ -54,7 +59,7 @@ let MessageItem = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}, [message, nextMessage, isFromSelf, isNextFromSelf])
|
}, [message, nextMessage, isFromSelf, isNextFromSelf, isPending])
|
||||||
|
|
||||||
const lastInGroupRef = useRef(isLastInGroup)
|
const lastInGroupRef = useRef(isLastInGroup)
|
||||||
if (lastInGroupRef.current !== isLastInGroup) {
|
if (lastInGroupRef.current !== isLastInGroup) {
|
||||||
|
|||||||
@@ -945,6 +945,7 @@ export class Convo {
|
|||||||
key: m.id,
|
key: m.id,
|
||||||
message: {
|
message: {
|
||||||
...m.message,
|
...m.message,
|
||||||
|
$type: 'chat.bsky.convo.defs#messageView',
|
||||||
id: nanoid(),
|
id: nanoid(),
|
||||||
rev: '__fake__',
|
rev: '__fake__',
|
||||||
sentAt: new Date().toISOString(),
|
sentAt: new Date().toISOString(),
|
||||||
|
|||||||
Reference in New Issue
Block a user