added checks if your name does not exist yet

This commit is contained in:
Thomas G 2022-06-20 13:48:12 +10:00
parent 4b81bc8d1d
commit 2d176e2928
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,9 @@ window.onload = function() {
}
var usernamecontainer = document.getElementById("UsernameContainer");
var username = localStorage.getItem("username");
if (username == null) {
username = ""
}
usernamecontainer.innerHTML = "Your username is: " + username
document.getElementById('UsernameButton').onclick = function() {
var usernameset = document.getElementById("UsernameSet").value;