From b63bd3096dfe842608c53e8db4c0a7d6bc712bca Mon Sep 17 00:00:00 2001 From: n9k Date: Wed, 29 Jun 2022 02:36:09 +0000 Subject: [PATCH] JS: set `ws = null;` before creating new websocket --- anonstream/static/anonstream.js | 1 + 1 file changed, 1 insertion(+) diff --git a/anonstream/static/anonstream.js b/anonstream/static/anonstream.js index 4b071ff..6a9c9db 100644 --- a/anonstream/static/anonstream.js +++ b/anonstream/static/anonstream.js @@ -851,6 +851,7 @@ const connect_websocket = () => { } chat_live_ball.style.borderColor = "gold"; chat_live_status.innerHTML = "Connecting to chat...···"; + ws = null; ws = new WebSocket(`ws://${document.domain}:${location.port}/live?token=${encodeURIComponent(TOKEN)}`); ws.addEventListener("open", (event) => { console.log("websocket open", event);