Merge pull request #8072 from gabrielbazan7/fix/creatingTxprocess

FIX: remove on going process if err
This commit is contained in:
Gustavo Maximiliano Cortez 2018-02-19 16:34:58 -03:00 committed by GitHub
commit f737164be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -573,8 +573,10 @@ export class ConfirmPage {
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
this.logger.info('No signing proposal: No private key');
this.walletProvider.onlyPublish(wallet, txp).then(() => {
this.onGoingProcessProvider.clear();
this.openSuccessModal(true);
}).catch((err: any) => {
this.onGoingProcessProvider.clear();
this.setSendError(err);
});
return;
@ -595,15 +597,13 @@ export class ConfirmPage {
confirmTx().then((nok: boolean) => {
if (nok) {
this.onGoingProcessProvider.clear();
return;
}
publishAndSign();
}).catch((err: any) => {
this.logger.warn(err);
return;
});
}).catch((err: any) => {
this.onGoingProcessProvider.set('creatingTx', false);
this.onGoingProcessProvider.clear();
this.logger.warn(err);
return;
});

View File

@ -1159,11 +1159,9 @@ export class WalletProvider {
this.ongoingProcessProvider.set('sendingTx', true);
this.publishTx(wallet, txp).then((publishedTxp) => {
this.invalidateCache(wallet);
this.ongoingProcessProvider.set('sendingTx', false);
this.events.publish('Local/TxAction', wallet.id);
return resolve();
}).catch((err) => {
this.ongoingProcessProvider.set('sendingTx', false);
return reject(this.bwcErrorProvider.msg(err));
});
});
@ -1225,6 +1223,7 @@ export class WalletProvider {
return reject(err);
});
}).catch((err) => {
this.ongoingProcessProvider.clear();
return reject(this.bwcErrorProvider.msg(err));
});
} else {
@ -1241,6 +1240,7 @@ export class WalletProvider {
return reject(this.bwcErrorProvider.msg(err));
});
}).catch((err) => {
this.ongoingProcessProvider.clear();
return reject(this.bwcErrorProvider.msg(err));
});
};