Skip to content

Commit 5631204

Browse files
committed
Fix amount of messages initially being shown
1 parent dceef19 commit 5631204

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

website/client/src/store/actions/chat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Vue from 'vue';
33
import * as Analytics from '@/libs/analytics';
44

55
export async function getChat (store, payload) {
6-
const response = await axios.get(`/api/v4/groups/${payload.groupId}/chat`);
6+
const response = await axios.get(`/api/v4/groups/${payload.groupId}/chat?limit=400`);
77

88
return response.data.data;
99
}

website/server/controllers/api-v3/chat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function textContainsBannedSlur (message) {
6464
*
6565
* @apiParam (Path) {String} groupId The group _id ('party' for the user party and
6666
* 'habitrpg' for tavern are accepted).
67-
* @apiParam (Query) {Number} [limit=50] The number of messages to fetch (max 200).
67+
* @apiParam (Query) {Number} [limit=50] The number of messages to fetch (max 400).
6868
* @apiParam (Query) {String} [before] Fetch messages older than this message ID.
6969
*
7070
* @apiSuccess {Array} data An array of <a href='https://github.com/HabitRPG/habitica/blob/develop/website/server/models/group.js#L51' target='_blank'>chat messages</a>
@@ -85,7 +85,7 @@ api.getChat = {
8585
if (validationErrors) throw validationErrors;
8686

8787
const { groupId } = req.params;
88-
const limit = req.query.limit ? Math.min(parseInt(req.query.limit, 10), 200) : 50;
88+
const limit = req.query.limit ? Math.min(parseInt(req.query.limit, 10), 400) : 50;
8989
const { before } = req.query;
9090

9191
const group = await Group.getGroup({ user, groupId, fields: 'chat privacy' });

website/server/libs/inbox/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function getUserInbox (user, optionParams = getUserInboxDefaultOpti
6060
.limit(PM_PER_PAGE);
6161
} else {
6262
// Limit for legacy calls that are not paginated to prevent database issues
63-
query = query.limit(200);
63+
query = query.limit(400);
6464
}
6565

6666
const messages = (await query.lean().exec()).map(msgObj => {

0 commit comments

Comments
 (0)