Better login
This commit is contained in:
parent
decf98e1b7
commit
80af9c120e
1 changed files with 7 additions and 5 deletions
|
@ -150,7 +150,7 @@
|
|||
let priceDivider = await contract.methods.getPriceDivider().call();
|
||||
accounts = await ethereum.request({ method: 'eth_requestAccounts' });
|
||||
document.getElementById("address").value = accounts[0];
|
||||
|
||||
|
||||
let allowed = new web3.utils.BN(await tokenContract.methods.allowance(accounts[0], ContractAddress).call());
|
||||
let sellWei = new web3.utils.BN(await web3.utils.toWei(sellAmount, 'ether'));
|
||||
if (allowed.gte(sellWei)) {
|
||||
|
@ -181,7 +181,7 @@
|
|||
document.getElementById("address").value = accounts[0];
|
||||
hideLogin();
|
||||
showSwap();
|
||||
if(contract == undefined){
|
||||
if (contract == undefined) {
|
||||
initContracts();
|
||||
}
|
||||
}
|
||||
|
@ -243,9 +243,11 @@
|
|||
initContracts();
|
||||
web3.eth.getAccounts().then(account => {
|
||||
console.log(account);
|
||||
document.getElementById("address").value = account[0];
|
||||
hideLogin();
|
||||
showSwap();
|
||||
if (account.length > 0) {
|
||||
document.getElementById("address").value = account[0];
|
||||
hideLogin();
|
||||
showSwap();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue