I am trying to pull up a Modal when I call isAuthenticated in a function.
My project is built in simple Bootstrap using HTML-CSS-JS
When the user clicks on a button it opens up MetaMask and requests to Sign it for entering an Airdrop. This is connected to Moralis and stores the wallet address. After the user signs the message on MetaMask, I want it to open up a Modal which will then tell the user what action was taken by them for the Airdrop. i.e.: âYou have entered the Airdrop Sweepstake.â
Everything works up until the isAuthenticated. I am able to sign the message and this stores into Moralis. The problem starts after login(); Below is the breakdown. I have a Modal in Bootstrap
Then I have stored the modal as a var
Then the action
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
var modal = document.getElementById("modal");
document.getElementById("btn-login").onclick = function() {
login();
if(!isAuthenticated, user) {
console.log(isAuthenticated, user);
}
else if(authError) {
console.log(authError);
}
};
Instead of calling the Modal, I have used a console.log, just to see if I can access isAuthenticated. I donât know if I am doing this correctly. How would I call the Modal after the signingMessage?