|
|
@ -76,11 +76,9 @@ class formHandler { |
|
|
|
xhr.setRequestHeader('Content-Type', 'application/json'); |
|
|
|
xhr.setRequestHeader('Content-Type', 'application/json'); |
|
|
|
postData = formToJSON(this.form); |
|
|
|
postData = formToJSON(this.form); |
|
|
|
} |
|
|
|
} |
|
|
|
let isLive = localStorage.getItem('live') == 'true' && socket && socket.connected; |
|
|
|
if (this.banned) { |
|
|
|
if (!this.banned && !isLive) { |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (!this.banned) { |
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.submit.disabled = true; |
|
|
|
this.submit.disabled = true; |
|
|
@ -158,7 +156,10 @@ class formHandler { |
|
|
|
this.submit.disabled = false; |
|
|
|
this.submit.disabled = false; |
|
|
|
} |
|
|
|
} |
|
|
|
xhr.open(this.form.getAttribute('method'), this.form.getAttribute('action'), true); |
|
|
|
xhr.open(this.form.getAttribute('method'), this.form.getAttribute('action'), true); |
|
|
|
|
|
|
|
const isLive = localStorage.getItem('live') == 'true' && socket && socket.connected; |
|
|
|
|
|
|
|
if (isLive) { |
|
|
|
xhr.setRequestHeader('x-using-xhr', true); |
|
|
|
xhr.setRequestHeader('x-using-xhr', true); |
|
|
|
|
|
|
|
} |
|
|
|
xhr.send(postData); |
|
|
|
xhr.send(postData); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|