Update 7.MessagesExtra.ts

This commit is contained in:
Adhiraj Singh
2020-10-25 21:23:32 +05:30
parent 51672150e4
commit ad0f35a1cd

View File

@@ -108,7 +108,7 @@ export class WAConnection extends Base {
const cursorValue = hasCursor && chat.messages.get (GET_MESSAGE_ID(cursor))
let messages: WAMessage[]
if (chat && mostRecentFirst && (!hasCursor || cursorValue)) {
if (chat?.messages && mostRecentFirst && (!hasCursor || cursorValue)) {
messages = chat.messages.paginatedByValue (cursorValue, count, null, 'before')
const diff = count - messages.length