aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-03-21 17:36:28 +0100
committersD <stoned@derpymail.org>2020-03-21 17:36:28 +0100
commitd025e6fb809c6e85f0f3444aae2ae39f744502ad (patch)
tree62163ca12ae6887560b896c719249f646fe9e4eb
parent93ce20fe74d2275ed6efe9af73baceda24231110 (diff)
fix #43 by clearing it on dead connection
-rw-r--r--webAO/client.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 4facca7..6fda3fc 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -478,6 +478,11 @@ class Client extends EventEmitter {
*/
cleanup() {
clearInterval(this.checkUpdater);
+
+ // the connection got rekt, get rid of the old musiclist
+ document.getElementById("areas").innerHTML = "";
+ document.getElementById("client_musiclist").innerHTML = "";
+ document.getElementById("client_chartable").innerHTML = "";
}
/**
@@ -2166,7 +2171,9 @@ export function ReconnectButton() {
client = new Client(serverIP);
if (client) {
mode = "join"; // HACK: see client.onOpen
+
document.getElementById("client_error").style.display = "none";
+
}
}
window.ReconnectButton = ReconnectButton;