From d5f2492ce5f9b8e3205ea2d7f5c77e5c86e76541 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Fri, 12 Mar 2021 13:06:31 -0500 Subject: [PATCH] Fine tune the conversation load experience --- ts/components/conversation/Timeline.tsx | 2 +- ts/views/conversation_view.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ts/components/conversation/Timeline.tsx b/ts/components/conversation/Timeline.tsx index f48fd0e95b..e7759d8b45 100644 --- a/ts/components/conversation/Timeline.tsx +++ b/ts/components/conversation/Timeline.tsx @@ -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; diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index 6587ae6474..b6af9c56d1 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -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.