Merge pull request #20 from embark-framework/bugfix/onReady
Fix showing the indicator
This commit is contained in:
commit
848238dc80
|
@ -108,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;
|
||||
});
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue