Closed cupOJoseph closed 5 years ago
try {
if (this.state.config.DEBUG) console.log('DAPPARATUS - getting accounts...');
window.web3.eth.getAccounts((err, _accounts) => {
//console.log("ACCOUNTS",err,_accounts)
if (!_accounts || _accounts.length <= 0 || this.state.web3Fellback) {
if (!this.state.hasRequestedAccess) { // Prevent multiple prompts
if (this.state.config.DEBUG) console.log('METAMASK - requesting access from user...');
this.setState({ hasRequestedAccess: true},() => {
this.props.onUpdate(this.state);
});
try{
window.ethereum.enable().then(() => {
window.location.reload(true);
})
} catch (e) {
console.log(e);
this.setState({ status: 'private', network: network },() => {
this.props.onUpdate(this.state);
});
}
}
@blockchainbuddha
still open while fixing merge conflict
solved in #36
ask user to sign metamask to inject web3