mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 04:29:15 +00:00
fix: fetchMessages when msgs length is smaller than limit (#438)
This commit is contained in:
@@ -184,7 +184,8 @@ class Chat extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
|
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
|
||||||
return msgs.splice(msgs.length - limit).map(m => window.WWebJS.getMessageModel(m));
|
if (msgs.length > limit) msgs = msgs.splice(msgs.length - limit);
|
||||||
|
return msgs.map(m => window.WWebJS.getMessageModel(m));
|
||||||
|
|
||||||
}, this.id._serialized, searchOptions.limit);
|
}, this.id._serialized, searchOptions.limit);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user