From bf43f2533d1386053f98b18aa640168367583c79 Mon Sep 17 00:00:00 2001 From: elijahr2411 Date: Thu, 26 Jan 2023 11:33:48 -0500 Subject: [PATCH] Fix an issue that caused messages to double if you clicked a vm more than once Expose the multicollab function --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f9b272b..b715436 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,7 @@ import { GetKeysym } from "./keyboard"; // In queue = var turn = -1; var perms = 0; +var connected = false; const vms = []; const users = []; const buttons = { @@ -348,6 +349,8 @@ function chatMessage(username, msg) { chatList.appendChild(tr); } async function openVM(url, node) { + if (connected) return; + connected = true; vm = new CollabVMClient(url); await vm.connect(); connected = true; @@ -399,4 +402,5 @@ votenobtn.addEventListener('click', () => vm.voteReset(false)); config.serverAddresses.forEach(multicollab); // Export some stuff -window.screenshotVM = screenshotVM; \ No newline at end of file +window.screenshotVM = screenshotVM; +window.multicollab = multicollab; \ No newline at end of file