diff --git a/app/lib/methods/loadMessagesForRoom.js b/app/lib/methods/loadMessagesForRoom.js index 8d57d2c8e..7f724de7d 100644 --- a/app/lib/methods/loadMessagesForRoom.js +++ b/app/lib/methods/loadMessagesForRoom.js @@ -14,7 +14,7 @@ async function loadMessagesForRoomRest({ rid: roomId, latest, t }) { if (latest) { latest = new Date(latest).toISOString(); } - const data = await SDK.api.get(`${ types[t] }.history`, { roomId, latest }); + const data = await SDK.api.get(`${ types[t] }.history`, { roomId, latest, count: 50 }); if (!data || data.status === 'error') { return []; } diff --git a/app/lib/methods/loadMissedMessages.js b/app/lib/methods/loadMissedMessages.js index 225dc6f1f..4bcdd0e36 100644 --- a/app/lib/methods/loadMissedMessages.js +++ b/app/lib/methods/loadMissedMessages.js @@ -10,7 +10,7 @@ async function loadMissedMessagesRest({ rid: roomId, lastOpen }) { if (lastOpen) { lastUpdate = new Date(lastOpen).toISOString(); } - const { result } = await SDK.api.get('chat.syncMessages', { roomId, lastUpdate }); + const { result } = await SDK.api.get('chat.syncMessages', { roomId, lastUpdate, count: 50 }); return result; } @@ -18,7 +18,7 @@ async function loadMissedMessagesDDP(...args) { const [{ rid, lastOpen: lastUpdate }] = args; try { - const result = await SDK.driver.asyncCall('messages/get', rid, { lastUpdate: new Date(lastUpdate) }); + const result = await SDK.driver.asyncCall('messages/get', rid, { lastUpdate: new Date(lastUpdate), count: 50 }); return result; } catch (e) { return loadMissedMessagesRest.call(this, ...args); diff --git a/app/views/RoomView/index.js b/app/views/RoomView/index.js index f5c546cbc..05dbd087f 100644 --- a/app/views/RoomView/index.js +++ b/app/views/RoomView/index.js @@ -162,7 +162,7 @@ export default class RoomView extends LoggedView { const { room } = this.state; try { const result = await RocketChat.loadMessagesForRoom({ rid: this.rid, t: room.t, latest: lastRowData.ts }); - this.internalSetState({ end: result < 20 }); + this.internalSetState({ end: result < 50 }); } catch (e) { log('RoomView.onEndReached', e); }