prevent duplicate connection
This commit is contained in:
parent
d1295bcc2f
commit
39fb90382c
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@ const elements = {
|
||||||
logonWindow: document.getElementById("logonWindow") as HTMLDivElement,
|
logonWindow: document.getElementById("logonWindow") as HTMLDivElement,
|
||||||
logonForm: document.getElementById("logonForm") as HTMLFormElement,
|
logonForm: document.getElementById("logonForm") as HTMLFormElement,
|
||||||
logonUsername: document.getElementById("logonUsername") as HTMLInputElement,
|
logonUsername: document.getElementById("logonUsername") as HTMLInputElement,
|
||||||
|
logonButton: document.getElementById("logonButton") as HTMLButtonElement,
|
||||||
agentSelect: document.getElementById("agentSelect") as HTMLSelectElement,
|
agentSelect: document.getElementById("agentSelect") as HTMLSelectElement,
|
||||||
|
|
||||||
chatView: document.getElementById("chatView") as HTMLDivElement,
|
chatView: document.getElementById("chatView") as HTMLDivElement,
|
||||||
|
@ -26,7 +27,11 @@ let logonWindow = new MSWindow(elements.logonWindow, {
|
||||||
|
|
||||||
logonWindow.show();
|
logonWindow.show();
|
||||||
|
|
||||||
|
let loggingIn = false;
|
||||||
elements.logonForm.addEventListener('submit', e => {
|
elements.logonForm.addEventListener('submit', e => {
|
||||||
|
if (loggingIn) return;
|
||||||
|
loggingIn = true;
|
||||||
|
elements.logonButton.disabled = true;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
connectToRoom();
|
connectToRoom();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue