Only append nextMessage to messages
This commit is contained in:
+21
-19
@@ -405,9 +405,6 @@ export class Convo {
|
|||||||
})
|
})
|
||||||
this.commit()
|
this.commit()
|
||||||
|
|
||||||
// UNCOMMENT TO TEST RETRIES
|
|
||||||
// await new Promise(y => setTimeout(y, 2000))
|
|
||||||
|
|
||||||
if (!this.isProcessingPendingMessages) {
|
if (!this.isProcessingPendingMessages) {
|
||||||
this.processPendingMessages()
|
this.processPendingMessages()
|
||||||
}
|
}
|
||||||
@@ -472,28 +469,33 @@ export class Convo {
|
|||||||
try {
|
try {
|
||||||
return items.map((item, i) => {
|
return items.map((item, i) => {
|
||||||
let nextMessage = null
|
let nextMessage = null
|
||||||
|
const isMessage = isConvoItemMessage(item)
|
||||||
|
|
||||||
if (
|
if (isMessage) {
|
||||||
isConvoItemMessage(item) &&
|
|
||||||
(ChatBskyConvoDefs.isMessageView(item.message) ||
|
|
||||||
ChatBskyConvoDefs.isDeletedMessageView(item.message))
|
|
||||||
) {
|
|
||||||
const next = items[i - 1]
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isConvoItemMessage(next) &&
|
isMessage &&
|
||||||
next &&
|
(ChatBskyConvoDefs.isMessageView(item.message) ||
|
||||||
(ChatBskyConvoDefs.isMessageView(next.message) ||
|
ChatBskyConvoDefs.isDeletedMessageView(item.message))
|
||||||
ChatBskyConvoDefs.isDeletedMessageView(next.message))
|
|
||||||
) {
|
) {
|
||||||
nextMessage = next.message
|
const next = items[i - 1]
|
||||||
|
|
||||||
|
if (
|
||||||
|
isConvoItemMessage(next) &&
|
||||||
|
next &&
|
||||||
|
(ChatBskyConvoDefs.isMessageView(next.message) ||
|
||||||
|
ChatBskyConvoDefs.isDeletedMessageView(next.message))
|
||||||
|
) {
|
||||||
|
nextMessage = next.message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
nextMessage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return item
|
||||||
...item,
|
|
||||||
nextMessage,
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user