Fix showing the indicator

This commit is contained in:
Anthony Laibe 2018-09-07 15:38:28 +01:00
parent 52122e12a5
commit 91475d44b9
2 changed files with 5 additions and 6 deletions

View File

@ -99,7 +99,6 @@ let Contract = function (options) {
if (Contract.isNewWeb3(this.web3)) {
ContractClass = new this.web3.eth.Contract(this.abi, this.address);
ContractClass.setProvider(this.web3.currentProvider);
ContractClass.options.data = this.code;
ContractClass.options.from = this.from || this.web3.eth.defaultAccount;
ContractClass.abi = ContractClass.options.abi;
@ -109,7 +108,9 @@ let Contract = function (options) {
let originalMethods = Object.keys(ContractClass);
Blockchain.execWhenReady(function() {
ContractClass.setProvider(web3.currentProvider);
if(!ContractClass.currentProvider){
ContractClass.setProvider(web3.currentProvider);
}
ContractClass.options.from = web3.eth.defaultAccount;
});

View File

@ -6,10 +6,8 @@ import Utils from './utils';
var EmbarkJS = {
onReady: function (cb) {
if (this.Blockchain.done) {
return cb();
}
this.Blockchain.finalCb = function() {
Blockchain.execWhenReady(cb)
Blockchain.finalCb = function() {
cb();
}
}