From 2c5959874eb67be15e99bea7f58a170383d68d88 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 22 May 2021 17:40:59 +0200 Subject: [PATCH] :bug: fix member sidebar --- src/Server.ts | 2 +- src/opcodes/LazyRequest.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Server.ts b/src/Server.ts index 193bdad1..46ff56a3 100644 --- a/src/Server.ts +++ b/src/Server.ts @@ -30,7 +30,7 @@ export class Server { async setupSchema() { // TODO: adjust expireAfterSeconds -> lower - await db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 }); + await Promise.all([db.collection("events").createIndex({ created_at: 1 }, { expireAfterSeconds: 60 })]); } async listen(): Promise { diff --git a/src/opcodes/LazyRequest.ts b/src/opcodes/LazyRequest.ts index 1d52ff3c..8b97e84a 100644 --- a/src/opcodes/LazyRequest.ts +++ b/src/opcodes/LazyRequest.ts @@ -14,6 +14,7 @@ import { Send } from "../util/Send"; import WebSocket from "../util/WebSocket"; import { check } from "./instanceOf"; +// TODO: check permission and only show roles/members that have access to this channel // TODO: config: if want to list all members (even those who are offline) sorted by role, or just those who are online export async function onLazyRequest(this: WebSocket, { d }: Payload) { @@ -41,7 +42,7 @@ export async function onLazyRequest(this: WebSocket, { d }: Payload) { let: { id: "$id" }, pipeline: [ { $match: { $expr: { $in: ["$$id", "$roles"] } } }, - { $limit: 1 }, + { $limit: 100 }, { $lookup: { from: "users",