mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix undefined error on messages fetch
This commit is contained in:
@@ -202,8 +202,12 @@ export default(
|
||||
|
||||
let messages: WAMessage[]
|
||||
if(list && mode === 'before' && (!cursorKey || cursorValue)) {
|
||||
const msgIdx = list.array.findIndex(m => m.key.id === cursorKey.id)
|
||||
messages = list.array.slice(0, msgIdx)
|
||||
if(cursorValue) {
|
||||
const msgIdx = list.array.findIndex(m => m.key.id === cursorKey.id)
|
||||
messages = list.array.slice(0, msgIdx)
|
||||
} else {
|
||||
messages = list.array
|
||||
}
|
||||
|
||||
const diff = count - messages.length
|
||||
if (diff < 0) {
|
||||
|
||||
Reference in New Issue
Block a user