JS: set `ws = null;` before creating new websocket

このコミットが含まれているのは:
n9k 2022-06-29 02:36:09 +00:00
コミット b63bd3096d
1個のファイルの変更1行の追加0行の削除

ファイルの表示

@ -851,6 +851,7 @@ const connect_websocket = () => {
}
chat_live_ball.style.borderColor = "gold";
chat_live_status.innerHTML = "<span data-verbose='true'>Connecting to chat...</span><span data-verbose='false'>&middot;&middot;&middot;</span>";
ws = null;
ws = new WebSocket(`ws://${document.domain}:${location.port}/live?token=${encodeURIComponent(TOKEN)}`);
ws.addEventListener("open", (event) => {
console.log("websocket open", event);