Fix loading newer messages on scroll

This commit is contained in:
Fedor Indutny 2024-08-22 11:37:34 -07:00 committed by GitHub
parent c901708281
commit 187d80066e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -1561,6 +1561,7 @@ export class ConversationModel extends window.Backbone
});
let messages: ReadonlyArray<MessageAttributesType>;
let unboundedFetch = true;
if (metrics.oldestUnseen) {
const unseen = await getMessageById(metrics.oldestUnseen.id);
if (!unseen) {
@ -1587,6 +1588,7 @@ export class ConversationModel extends window.Backbone
messages = [...older, unseen, ...newer];
metrics = freshMetrics;
unboundedFetch = false;
} else {
messages = await getOlderMessagesByConversation({
conversationId: this.id,
@ -1607,6 +1609,7 @@ export class ConversationModel extends window.Backbone
conversationId: this.id,
messages: cleaned,
metrics,
unboundedFetch,
});
} finally {
finish();