made the index webpage into two parts

added register/login links when not logged in
when logged in, chat and profile links are shown
This commit is contained in:
Mystikfluu
2022-05-26 14:37:13 +02:00
parent eee57759f9
commit 69790c32d5
2 changed files with 32 additions and 12 deletions
+8
View File
@@ -0,0 +1,8 @@
window.addEventListener("load",async function(){
let data = await(await fetch("/api/getuser")).json()
if(data["username"] != undefined) {
document.getElementById("HasAccount").style=""
} else {
document.getElementById("NoAccount").style=""
}
})