Apply suggestions from code review

change variable declaration in login-events.js to const

Co-authored-by: André Staltz <andre@staltz.com>
This commit is contained in:
Henry 2021-03-26 14:49:04 +01:00 committed by GitHub
parent 1dd3f2891e
commit 544c05b290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
// get the challenge from out of the HTML
let sc = document.querySelector("#challenge").dataset.sc
var evtSource = new EventSource(`/withssb/events?sc=${sc}`);
const sc = document.querySelector("#challenge").dataset.sc
const evtSource = new EventSource(`/withssb/events?sc=${sc}`);
var ping = document.querySelector('#ping');
var failed = document.querySelector('#failed');
const ping = document.querySelector('#ping');
const failed = document.querySelector('#failed');
evtSource.onerror = (e) => {
failed.textContent = "Warning: The connection to the server was interupted."