Hi! I’m trying to fetch the username with user.get("username")
and read in a previous post that it’s an initial delay before fetching the data, hence the null value. I have a navigation component where I’m trying to fetch the username for a cloud function but every time I log in, it throws a null error and I need to refresh the page for it to initialize.
async function getUserData(){
const params={"username": user.get("username")}
const result = await Moralis.Cloud.run("getUserProfile", params)
setPhoto(`https://ipfs.moralis.io:2053/ipfs/${result.attributes.imageHash}`)
console.log("result", result)
}
Is there a workaround that could solve this issue? Any help would be appreciated!