Fine tune the conversation load experience
This commit is contained in:
parent
8dc8a64229
commit
d5f2492ce5
2 changed files with 7 additions and 7 deletions
|
@ -28,7 +28,7 @@ const NEAR_BOTTOM_THRESHOLD = 15;
|
||||||
const AT_TOP_THRESHOLD = 10;
|
const AT_TOP_THRESHOLD = 10;
|
||||||
const LOAD_MORE_THRESHOLD = 30;
|
const LOAD_MORE_THRESHOLD = 30;
|
||||||
const SCROLL_DOWN_BUTTON_THRESHOLD = 8;
|
const SCROLL_DOWN_BUTTON_THRESHOLD = 8;
|
||||||
export const LOAD_COUNTDOWN = 2 * 1000;
|
export const LOAD_COUNTDOWN = 1;
|
||||||
|
|
||||||
export type PropsDataType = {
|
export type PropsDataType = {
|
||||||
haveNewest: boolean;
|
haveNewest: boolean;
|
||||||
|
|
|
@ -835,7 +835,7 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
receivedAt,
|
receivedAt,
|
||||||
sentAt,
|
sentAt,
|
||||||
messageId: oldestMessageId,
|
messageId: oldestMessageId,
|
||||||
limit: 500,
|
limit: 30,
|
||||||
MessageCollection: Whisper.MessageCollection,
|
MessageCollection: Whisper.MessageCollection,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -890,7 +890,7 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
const models = await getNewerMessagesByConversation(this.model.id, {
|
const models = await getNewerMessagesByConversation(this.model.id, {
|
||||||
receivedAt,
|
receivedAt,
|
||||||
sentAt,
|
sentAt,
|
||||||
limit: 500,
|
limit: 30,
|
||||||
MessageCollection: Whisper.MessageCollection,
|
MessageCollection: Whisper.MessageCollection,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1073,14 +1073,14 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
const receivedAt = message.get('received_at');
|
const receivedAt = message.get('received_at');
|
||||||
const sentAt = message.get('sent_at');
|
const sentAt = message.get('sent_at');
|
||||||
const older = await getOlderMessagesByConversation(conversationId, {
|
const older = await getOlderMessagesByConversation(conversationId, {
|
||||||
limit: 250,
|
limit: 30,
|
||||||
receivedAt,
|
receivedAt,
|
||||||
sentAt,
|
sentAt,
|
||||||
messageId,
|
messageId,
|
||||||
MessageCollection: Whisper.MessageCollection,
|
MessageCollection: Whisper.MessageCollection,
|
||||||
});
|
});
|
||||||
const newer = await getNewerMessagesByConversation(conversationId, {
|
const newer = await getNewerMessagesByConversation(conversationId, {
|
||||||
limit: 250,
|
limit: 30,
|
||||||
receivedAt,
|
receivedAt,
|
||||||
sentAt,
|
sentAt,
|
||||||
MessageCollection: Whisper.MessageCollection,
|
MessageCollection: Whisper.MessageCollection,
|
||||||
|
@ -1147,7 +1147,7 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
const messages = await getOlderMessagesByConversation(conversationId, {
|
const messages = await getOlderMessagesByConversation(conversationId, {
|
||||||
limit: 50,
|
limit: 30,
|
||||||
MessageCollection: Whisper.MessageCollection,
|
MessageCollection: Whisper.MessageCollection,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1157,7 +1157,7 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
setFocus && metrics.newest ? metrics.newest.id : undefined;
|
setFocus && metrics.newest ? metrics.newest.id : undefined;
|
||||||
|
|
||||||
// Because our `getOlderMessages` fetch above didn't specify a receivedAt, we got
|
// 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
|
// 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
|
// reducer to trust the message set we just fetched for determining if we have
|
||||||
// the newest message loaded.
|
// the newest message loaded.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue