From d99a619e26f38c729d74d8dc585e8ce13236ffb7 Mon Sep 17 00:00:00 2001 From: Caleb Date: Thu, 8 Sep 2022 00:51:31 -0400 Subject: Removed all window functions from client --- webAO/dom/reconnectButton.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 webAO/dom/reconnectButton.ts (limited to 'webAO/dom/reconnectButton.ts') diff --git a/webAO/dom/reconnectButton.ts b/webAO/dom/reconnectButton.ts new file mode 100644 index 0000000..4031ccd --- /dev/null +++ b/webAO/dom/reconnectButton.ts @@ -0,0 +1,16 @@ +import Client, { client, setClient } from "../client"; +import queryParser from "../utils/queryParser"; +let { ip: serverIP } = queryParser(); + +/** + * Triggered when the reconnect button is pushed. + */ +export function ReconnectButton() { + client.cleanup(); + setClient(new Client(serverIP)); + + if (client) { + document.getElementById("client_error")!.style.display = "none"; + } +} +window.ReconnectButton = ReconnectButton; \ No newline at end of file -- cgit