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");
clientList.clear();
channelList.clear();
console.log(clientList);
drawClients();
main(); // Reconnected
};

View File

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

View File

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