no more evil while loop
This commit is contained in:
+4
-10
@@ -51,16 +51,10 @@ export default Service.extend({
|
|||||||
initializeKreditsContract() {
|
initializeKreditsContract() {
|
||||||
let contract = null;
|
let contract = null;
|
||||||
|
|
||||||
while (contract === null) {
|
if (isPresent(config.contractMetadata)) {
|
||||||
try {
|
contract = kreditsContracts(this.get('web3'), config.contractMetadata)['Kredits'];
|
||||||
if (isPresent(config.contractMetadata)) {
|
} else {
|
||||||
contract = kreditsContracts(this.get('web3'), config.contractMetadata)['Kredits'];
|
contract = kreditsContracts(this.get('web3'))['Kredits'];
|
||||||
} else {
|
|
||||||
contract = kreditsContracts(this.get('web3'))['Kredits'];
|
|
||||||
}
|
|
||||||
} catch(e) {
|
|
||||||
Ember.Logger.debug('[kredits] error initializing kredits contract', e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return contract;
|
return contract;
|
||||||
|
|||||||
Reference in New Issue
Block a user