Fine tune the conversation load experience

This commit is contained in:
Josh Perez 2021-03-12 13:06:31 -05:00 committed by Josh Perez
parent 8dc8a64229
commit d5f2492ce5
2 changed files with 7 additions and 7 deletions

View file

@ -28,7 +28,7 @@ const NEAR_BOTTOM_THRESHOLD = 15;
const AT_TOP_THRESHOLD = 10;
const LOAD_MORE_THRESHOLD = 30;
const SCROLL_DOWN_BUTTON_THRESHOLD = 8;
export const LOAD_COUNTDOWN = 2 * 1000;
export const LOAD_COUNTDOWN = 1;
export type PropsDataType = {
haveNewest: boolean;

View file

@ -835,7 +835,7 @@ Whisper.ConversationView = Whisper.View.extend({
receivedAt,
sentAt,
messageId: oldestMessageId,
limit: 500,
limit: 30,
MessageCollection: Whisper.MessageCollection,
});
@ -890,7 +890,7 @@ Whisper.ConversationView = Whisper.View.extend({
const models = await getNewerMessagesByConversation(this.model.id, {
receivedAt,
sentAt,
limit: 500,
limit: 30,
MessageCollection: Whisper.MessageCollection,
});
@ -1073,14 +1073,14 @@ Whisper.ConversationView = Whisper.View.extend({
const receivedAt = message.get('received_at');
const sentAt = message.get('sent_at');
const older = await getOlderMessagesByConversation(conversationId, {
limit: 250,
limit: 30,
receivedAt,
sentAt,
messageId,
MessageCollection: Whisper.MessageCollection,
});
const newer = await getNewerMessagesByConversation(conversationId, {
limit: 250,
limit: 30,
receivedAt,
sentAt,
MessageCollection: Whisper.MessageCollection,
@ -1147,7 +1147,7 @@ Whisper.ConversationView = Whisper.View.extend({
}
const messages = await getOlderMessagesByConversation(conversationId, {
limit: 50,
limit: 30,
MessageCollection: Whisper.MessageCollection,
});
@ -1157,7 +1157,7 @@ Whisper.ConversationView = Whisper.View.extend({
setFocus && metrics.newest ? metrics.newest.id : undefined;
// Because our `getOlderMessages` fetch above didn't specify a receivedAt, we got
// the most recent 50 messages in the conversation. If it has a conflict with
// the most recent 30 messages in the conversation. If it has a conflict with
// metrics, fetched a bit before, that's likely a race condition. So we tell our
// reducer to trust the message set we just fetched for determining if we have
// the newest message loaded.