added more multi server stability

This commit is contained in:
Janis
2022-10-28 22:31:06 +02:00
parent 95d2acfb1e
commit b4b17187a4
3 changed files with 5 additions and 3 deletions

View File

@@ -59,7 +59,6 @@ function main() {
console.log("Disconnected"); console.log("Disconnected");
clientList.clear(); clientList.clear();
channelList.clear(); channelList.clear();
console.log(clientList);
drawClients(); drawClients();
main(); // Reconnected main(); // Reconnected
}; };

View File

@@ -29,6 +29,7 @@ function handleClientMoved(data) {
data.payload.newChannelId data.payload.newChannelId
); );
} else { } else {
console.log(data.payload);
// New Client has to be created // New Client has to be created
clientList.add( clientList.add(
new Client( new Client(

View File

@@ -2,8 +2,10 @@ function getClientsInChannel(channel) {
let result = []; let result = [];
clientList.items.forEach((e) => { clientList.items.forEach((e) => {
if (e.channel.id == channel.id) { if (e.channel) {
result.push(e); if (e.channel.id == channel.id) {
result.push(e);
}
} }
}); });
return result; return result;