Fix bug where user tries to join the room they are already in and breaks things

This commit is contained in:
Hri7566 2024-07-12 17:29:04 -04:00
parent a11020f4d5
commit 510dc8ac05
1 changed files with 3 additions and 4 deletions

View File

@ -124,11 +124,10 @@ export class Socket extends EventEmitter {
}
public setChannel(_id: string, set?: Partial<IChannelSettings>, 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;