From 510dc8ac05d3c603fe4f957e654c64077ea4278a Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Fri, 12 Jul 2024 17:29:04 -0400 Subject: [PATCH] Fix bug where user tries to join the room they are already in and breaks things --- src/ws/Socket.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ws/Socket.ts b/src/ws/Socket.ts index 5c69ef1..f6c4b96 100644 --- a/src/ws/Socket.ts +++ b/src/ws/Socket.ts @@ -124,11 +124,10 @@ export class Socket extends EventEmitter { } public setChannel(_id: string, set?: Partial, force: boolean = false) { + // Do we exist? if (this.isDestroyed()) return; - if (this.currentChannelID === _id) { - logger.debug("Guy in channel was already in"); - return; - } + // Are we trying to join the same channel like an idiot? + if (this.currentChannelID === _id) return; this.desiredChannel._id = _id; this.desiredChannel.set = set;