fix: fetchMessages infinite loop when there are no messages in the chat (#1480)
* Fix of fetchMessages * Node 12 compatibility
This commit is contained in:
parent
c0ef9223ed
commit
98ff761cfb
1 changed files with 1 additions and 1 deletions
|
|
@ -184,7 +184,7 @@ class Chat extends Base {
|
||||||
if (searchOptions && searchOptions.limit > 0) {
|
if (searchOptions && searchOptions.limit > 0) {
|
||||||
while (msgs.length < searchOptions.limit) {
|
while (msgs.length < searchOptions.limit) {
|
||||||
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat);
|
const loadedMessages = await window.Store.ConversationMsgs.loadEarlierMsgs(chat);
|
||||||
if (!loadedMessages) break;
|
if (!loadedMessages || !loadedMessages.length) break;
|
||||||
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue