Weird socket channel joining bug
This commit is contained in:
parent
3c9df73c63
commit
a78e188788
|
@ -125,24 +125,24 @@ export class Socket extends EventEmitter {
|
||||||
|
|
||||||
public setChannel(_id: string, set?: Partial<IChannelSettings>) {
|
public setChannel(_id: string, set?: Partial<IChannelSettings>) {
|
||||||
if (this.isDestroyed()) return;
|
if (this.isDestroyed()) return;
|
||||||
|
if (this.currentChannelID === _id) {
|
||||||
const ch = this.getCurrentChannel();
|
logger.debug("Guy in channel was already in");
|
||||||
if (ch && ch.getID() == _id) return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.desiredChannel._id = _id;
|
this.desiredChannel._id = _id;
|
||||||
this.desiredChannel.set = set;
|
this.desiredChannel.set = set;
|
||||||
|
|
||||||
let channel;
|
let channel;
|
||||||
for (const ch of ChannelList.getPublicList()) {
|
for (const ch of ChannelList.getList()) {
|
||||||
if (ch.getID() == _id) {
|
if (ch.getID() == _id) {
|
||||||
channel = ch;
|
channel = ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// logger.debug("Found channel:", channel);
|
|
||||||
|
|
||||||
// Does channel exist?
|
// Does channel exist?
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
logger.debug("Found channel:", channel.getID());
|
||||||
// Exists, join normally
|
// Exists, join normally
|
||||||
(async () => {
|
(async () => {
|
||||||
await this.loadUser();
|
await this.loadUser();
|
||||||
|
|
Loading…
Reference in New Issue