wait for latest block to eensure web3 object is ready

This commit is contained in:
Iuri Matias 2019-10-02 21:22:24 -04:00
parent f4789d0d60
commit 679609aef8
1 changed files with 4 additions and 4 deletions

View File

@ -147,10 +147,10 @@ export default class Subspace {
};
}
// TO FIX: this line makes everything explode
// It's supposed to obtain the current balance immediatly
// callFn();
this.web3.getBlock('latest').then(block => {
callFn();
});
this.callables.push(callFn);
return sub.pipe(distinctUntilChanged((a, b) => equal(a, b)));