fix username not being shown in dms

This commit is contained in:
Mystikfluu 2022-08-27 00:27:08 +02:00
parent cc4e2ce590
commit 7ceb781f55

View File

@ -270,13 +270,15 @@ async function main(){
user = await (await fetch("/api/getuser")).json() user = await (await fetch("/api/getuser")).json()
username = user.username username = user.username
if(!username){ if(!username){
user = undefined
document.getElementById("noaccount").style="" document.getElementById("noaccount").style=""
document.getElementById("loading").style="display:none;" document.getElementById("loading").style="display:none;"
console.log("no account"); console.log("no account");
return; return;
} }
document.getElementById("username-self").innerText = username
} }
username = user.username
document.getElementById("username-self").innerText = username
let all_posts = await (await fetch(`/api/getPersonalPosts?otherperson=${currentChannel}`)).json() let all_posts = await (await fetch(`/api/getPersonalPosts?otherperson=${currentChannel}`)).json()
if(!all_posts){ if(!all_posts){