Uncaught (in promise) ReferenceError: hideElement is not defined at initializeApp (main.js:5)

MoralisWeb3 = serverUrl = “://w6j9c9lnnoio.usemoralis.com:2053/server”; //Server url from moralis.io

MoralisWeb3 = appId = “wZsf07rYLfsPudepzTdjvrAsYfgWAQb0BFbnTFJI”; // Application id from moralis.io

async function initializeApp() {

** hideElement(userInfo)**

** await Moralis.start({ serverUrl, appId });**

** await Moralis.enableWeb3();**

** currentUser = Moralis.User.current();**

** if (!currentUser){**

** currentUser = await Moralis.Web3.authenticate();**

}

initUser = async () => {

** if (await Moralis.User.current()) {**

** hideElement(userConnectButton);**

** showElement(userProfileButton);**

** }else {**

** showElement(userConnectButton);**

** hideElement(userProfileButton);**


** }**

}

login = async () => {

** try {**

** await Moralis.Web3.authenticate();**

** initUser();**

** } catch (error) {**

** alert(error)**

** }**

}

logout = async () => {

** await Moralis.User.logOut();**

** hideElement(userInfo)**

** initUser();**

}

openUserInfo = async () => {

** user = await Moralis.User.current();**

** if (user){**

** showElement(userInfo);**

** }else{**

** login();**

** }**

}

hideElement = (element) => element.style.display = “none”;

showElement = (element) => element.style.display = “block”;

const userConnectButton = document.getElementById(“btn-login”);

userConnectButton.onclick = login;

const userProfileButton = document.getElementById(“userInfo”);

userProfileButton.onclick = openUserInfo;

const userInfo = document.getElementById(“userInfo”);

document.getElementById(“btn-CloseUserInfo”).onclick = () => hideElement(userInfo);

document.getElementById(“btn-logout”).onclick = logout;

document.getElementById(“userInfo”).style.display = “none”;

}

initializeApp();

Hi, you can see here how to post code in forum: READ BEFORE POSTING - How to post code in the forum

and you should also post your html code

ok bro wait, i am posting again

you can edit your post, you don’t have to post again