[SOLVED] Profile button not hide at login


Moralis.initialize("Bh0MLNPUycz7AV77HPnFFxHtsDnY6nkhz0skZY2k");

Moralis.serverURL = 'https://pof75zn8copb.moralishost.com:2053/server'

init = async () => {

    window.web3 = await Moralis.Web3.enable();

    initUser();

}

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)

    }

}

hideElement = (element) => element.style.display = "none";

showElement = (element) => element.style.display = "block";

const userConnectButton = document.getElementById("btnConnect");

userConnectButton.onclick = login;  

const userProfileButton = document.getElementById("btnUserInfo");

init();

can someone check my coding

What is the error that you get? (when. you look in your browser console)

already solved the problem thanks