Hi everyone.
Iâm trying to follow along with the âCloning Rarible in 24hâ tutorial on the Moralis YouTube. I have very little experience in programming though I know my way around some HTML.
I followed the first episode and when it came to loading up the website on localhost:8000 using Python, I see both the âConnect Walletâ and âProfileâ buttons. The buttons do not work in the Brave Browser to invoke the Ethereum wallet.
Iâve triple checked my code and my console in VS Code throws no errors. Am hoping someone can point me in the right direction? Maybe I didnât install some prerequisite?
Hereâs the code I have in my editor. Thanks in advance.
Moralis.initialize("-redacted-");
Moralis.serverURL = '-redacted-'
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();