diff --git a/config.js b/config.js index cdbfe9f..14dda9c 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,4 @@ const CONFIG = { - apiKey: "", remoteAppPort: 5899, style: { fontBackground: "rgba(19, 20, 33, 0.5)", diff --git a/js/app.js b/js/app.js index acf6cc0..2edcd94 100644 --- a/js/app.js +++ b/js/app.js @@ -8,7 +8,7 @@ function main() { name: "TS5 OBS Overlay", description: "A simple OBS overlay for TS5 by DerTyp876", content: { - apiKey: CONFIG.apiKey, + apiKey: apiKey, }, }, }; @@ -27,11 +27,7 @@ function main() { switch (data.type) { case "auth": handleAuthMessage(data); - console.log( - "%c --> API-KEY: %s ", - "color:red;font-weight:bold;", - ` ${data.payload.apiKey}` - ); + apiKey = data.payload.apiKey; break; case "clientMoved": handleClientMoved(data); @@ -54,15 +50,16 @@ function main() { }; ws.onerror = (err) => { - console.error(err); + console.log(err); ws.close(); return; }; ws.onclose = (event) => { - console.log("Disconnected: " + event.reason); + console.log("Disconnected"); clientList.clear(); channelList.clear(); + console.log(clientList); drawClients(); main(); // Reconnected }; diff --git a/js/display_content.js b/js/display_content.js index c42dcc3..90c79ca 100644 --- a/js/display_content.js +++ b/js/display_content.js @@ -2,22 +2,25 @@ function drawClients() { let elem = document.getElementById("content"); result = ""; - getClientsInChannel(thisClient.channel).forEach((c) => { - result += `
${c.name}
${c.name}