mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-05-25 09:54:13 +00:00
Merge pull request #287 from Rgoplay/fix-switching-acc-missing-channel
Added response code verification when loading a new channel
This commit is contained in:
+11
-6
@@ -1701,12 +1701,17 @@ class Guild extends SnowFlake {
|
||||
await fetch(this.info.api + "/channels/" + threadId, {
|
||||
headers: this.headers,
|
||||
})
|
||||
).json()) as channeljson;
|
||||
const channel = new Channel(channelJson, this);
|
||||
this.localuser.channelids.set(channel.id, channel);
|
||||
channel.resolveparent(this);
|
||||
const par = this.localuser.channelids.get(channel.parent_id as string);
|
||||
par?.createguildHTML();
|
||||
).json());
|
||||
if(channelJson.code == 200){
|
||||
const channel = new Channel(channelJson as channeljson, this);
|
||||
this.localuser.channelids.set(channel.id, channel);
|
||||
channel.resolveparent(this);
|
||||
const par = this.localuser.channelids.get(channel.parent_id as string);
|
||||
par?.createguildHTML();
|
||||
} else {
|
||||
this.loadChannel();
|
||||
}
|
||||
|
||||
}
|
||||
this.localuser.goToChannel(threadId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user