diff --git a/js/app.js b/js/app.js index 2edcd94..79759e1 100644 --- a/js/app.js +++ b/js/app.js @@ -59,7 +59,6 @@ function main() { console.log("Disconnected"); clientList.clear(); channelList.clear(); - console.log(clientList); drawClients(); main(); // Reconnected }; diff --git a/js/event_handlers.js b/js/event_handlers.js index 4ef3fde..b953ef6 100644 --- a/js/event_handlers.js +++ b/js/event_handlers.js @@ -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( diff --git a/js/utils.js b/js/utils.js index e8dee7c..b4dd7e9 100644 --- a/js/utils.js +++ b/js/utils.js @@ -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;