Skip to content

Commit

Permalink
migrate gitcoin from web3js 0.2 to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Usman committed Oct 9, 2018
1 parent 13bc312 commit 928e08c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ var listen_for_web3_changes = function() {
document.listen_for_web3_iterations += 1;
}

if (typeof web3 == 'undefined') {
/*if (typeof web3 == 'undefined') {
currentNetwork();
trigger_form_hooks();
} else if (typeof web3 == 'undefined' || typeof web3.eth == 'undefined' || typeof web3.eth.coinbase == 'undefined' || !web3.eth.coinbase) {
Expand All @@ -847,7 +847,16 @@ var listen_for_web3_changes = function() {
trigger_form_hooks();
}
});
}
}*/
web3.eth.net.getNetworkType().then(function (cb, err) {
if (err) {
currentNetwork();
}
else {
currentNetwork(cb);
trigger_form_hooks();
}
});
};

var actions_page_warn_if_not_on_same_network = function() {
Expand Down

0 comments on commit 928e08c

Please sign in to comment.