fix "Bio: null" bug

This commit is contained in:
Mystikfluu 2022-12-01 13:43:02 +01:00
parent ba6bb14457
commit 819e97a97d

View File

@ -32,7 +32,7 @@
async function getuser() { async function getuser() {
let user = await (await fetch("/api/getotheruser?user="+other_username)).json() let user = await (await fetch("/api/getotheruser?user="+other_username)).json()
document.getElementById('userName').innerText = `${(!user["error"] && "User: "+user.username) || "Error: "+user["error"]}` document.getElementById('userName').innerText = `${(!user["error"] && "User: "+user.username) || "Error: "+user["error"]}`
document.getElementById('userBio').innerText = `${(!user["error"] && "Bio: " + decodeURIComponent(user.bio)) || ""}` document.getElementById('userBio').innerText = `${(!user["error"] && "Bio: " + decodeURIComponent(user.bio||"wow such empty")) || ""}`
document.title = `${(!user["error"] && user.username+"'s Page") || "No such User!"}` document.title = `${(!user["error"] && user.username+"'s Page") || "No such User!"}`
let avatar = user["avatar"] let avatar = user["avatar"]
if(avatar) { if(avatar) {