Fix bug where user tries to join the room they are already in and breaks things
This commit is contained in:
parent
a11020f4d5
commit
510dc8ac05
|
@ -124,11 +124,10 @@ export class Socket extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public setChannel(_id: string, set?: Partial<IChannelSettings>, force: boolean = false) {
|
public setChannel(_id: string, set?: Partial<IChannelSettings>, force: boolean = false) {
|
||||||
|
// Do we exist?
|
||||||
if (this.isDestroyed()) return;
|
if (this.isDestroyed()) return;
|
||||||
if (this.currentChannelID === _id) {
|
// Are we trying to join the same channel like an idiot?
|
||||||
logger.debug("Guy in channel was already in");
|
if (this.currentChannelID === _id) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.desiredChannel._id = _id;
|
this.desiredChannel._id = _id;
|
||||||
this.desiredChannel.set = set;
|
this.desiredChannel.set = set;
|
||||||
|
|
Loading…
Reference in New Issue