Skip to content

Commit

Permalink
Fix metamask alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariano Aguero committed Oct 24, 2018
1 parent 21bd713 commit 67d0f39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/stepOne/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class stepOne extends React.Component {
}

componentDidMount() {
checkWeb3(this.props.web3Store.web3);
checkWeb3()

let downloadContracts = this.getWhiteListWithCapCrowdsaleAssets();

Expand Down
9 changes: 5 additions & 4 deletions src/utils/blockchainHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export function checkWeb3 () {
if (!web3) {
setTimeout(function () {
web3Store.getWeb3(web3 => {
if (!web3) return noMetaMaskAlert()
if (!web3) {
return noMetaMaskAlert()
}
checkMetaMask()
})
}, 500)
Expand All @@ -24,9 +26,8 @@ export function checkWeb3 () {

const checkMetaMask = () => {
const { web3 } = web3Store
console.log(web3.currentProvider)

if (!web3.currentProvider) {
if (!web3 || !web3.currentProvider) {
return noMetaMaskAlert()
}

Expand Down Expand Up @@ -477,4 +478,4 @@ export function getAllCrowdsaleAddresses () {
.catch((err) => {
console.log("err: ", err)
})
}
}

0 comments on commit 67d0f39

Please sign in to comment.