fix: fetchMessages when msgs length is smaller than limit (#438)
This commit is contained in:
parent
d86ccec5d1
commit
a1d09e0e21
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue