Skip to content
Snippets Groups Projects
Commit 3ff065aa authored by Tainan Felipe's avatar Tainan Felipe
Browse files

Fix messages load stuck

parent 2e5c90bb
No related branches found
No related tags found
No related merge requests found
......@@ -24,11 +24,15 @@ export default function chatMessageBeforeJoinCounter() {
const User = Users.findOne({ userId: requesterUserId, meetingId });
const chatIdWithCounter = groupChats.map((groupChat) => {
const msgCount = GroupChatMsg.find({ chatId: groupChat.chatId, timestamp: { $lt: User.authTokenValidatedTime } }).count();
const msgCount = GroupChatMsg.find({
meetingId,
chatId: groupChat.chatId,
timestamp: { $lt: User.authTokenValidatedTime },
}).count();
return {
chatId: groupChat.chatId,
count: msgCount,
};
}).filter(chat => chat.count);
}).filter((chat) => chat.count);
return chatIdWithCounter;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment