aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/reconnectButton.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/dom/reconnectButton.ts')
-rw-r--r--webAO/dom/reconnectButton.ts16
1 files changed, 16 insertions, 0 deletions
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