aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/reconnectButton.ts
blob: 079e7fc8cb7381a9467e5cfb0250bdda19ad9a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Client, { client, setClient } from "../client";
import queryParser from "../utils/queryParser";
const { 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;