Skip to content

Commit

Permalink
Fine tune the conversation load experience
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-signal committed Mar 19, 2021
1 parent 8dc8a64 commit d5f2492
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ts/components/conversation/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions ts/views/conversation_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ Whisper.ConversationView = Whisper.View.extend({
receivedAt,
sentAt,
messageId: oldestMessageId,
limit: 500,
limit: 30,
MessageCollection: Whisper.MessageCollection,
});

Expand Down Expand Up @@ -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,
});

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1147,7 +1147,7 @@ Whisper.ConversationView = Whisper.View.extend({
}

const messages = await getOlderMessagesByConversation(conversationId, {
limit: 50,
limit: 30,
MessageCollection: Whisper.MessageCollection,
});

Expand All @@ -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.
Expand Down

0 comments on commit d5f2492

Please sign in to comment.