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 16, 2018
1 parent 13bc312 commit 15aa3e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 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,15 @@ 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 15aa3e6

Please sign in to comment.