Created
May 12, 2020 14:55
-
-
Save dongido001/d144c0ffbbd100f8abed11a0d46e6b3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [...] | |
function checkAuthState() { | |
if (!user.value) { | |
document.getElementById("login-block").style.display = "grid" | |
document.getElementsByClassName("message-container")[0].style.display = "none"; | |
} else { | |
document.getElementsByClassName("message-container")[0].style.display = "grid"; | |
document.getElementById("login-block").style.display = "none" | |
username = user.value | |
initializeClient() // initiaize client | |
} | |
} | |
const user = document.getElementById("user-login-input") | |
user.addEventListener("keyup", function(event) { | |
if (event.key === "Enter") { | |
checkAuthState() | |
} | |
}); | |
checkAuthState() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment