From cc4e2ce590040d9643dd5ed05a0c6ddec0c2e39b Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sat, 27 Aug 2022 00:26:09 +0200 Subject: [PATCH] fix username not being shown --- js/posts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/posts.js b/js/posts.js index d92798c..29ec25d 100644 --- a/js/posts.js +++ b/js/posts.js @@ -235,13 +235,15 @@ async function main(){ user = await (await fetch("/api/getuser")).json() username = user.username if(!username){ + user = undefined document.getElementById("noaccount").style="" document.getElementById("loading").style="display:none;" console.log("no account"); return; } - document.getElementById("username-self").innerText = username } + username = user.username + document.getElementById("username-self").innerText = username let all_posts = await (await fetch(`/api/getPosts?channel=${currentChannel}`)).json() if(!all_posts)return;