diff --git a/src/pages/send/confirm/confirm.html b/src/pages/send/confirm/confirm.html index 9324e4a8c..3ebcd5768 100644 --- a/src/pages/send/confirm/confirm.html +++ b/src/pages/send/confirm/confirm.html @@ -9,7 +9,6 @@ - Sending
@@ -23,7 +22,15 @@
- +
+ To +
+
{{address}}
+
+
+
+ + From
{{wallet.name}}
@@ -35,6 +42,5 @@
-
To: {{address}}
-
Amount: {{amount}}
+ \ No newline at end of file diff --git a/src/pages/send/confirm/confirm.ts b/src/pages/send/confirm/confirm.ts index 23170f6f2..4a92e9e79 100644 --- a/src/pages/send/confirm/confirm.ts +++ b/src/pages/send/confirm/confirm.ts @@ -124,7 +124,7 @@ export class ConfirmPage { // Grab stateParams let tx: any = { - toAmount: parseFloat(this.navParams.data.amount), + toAmount: parseFloat(this.navParams.data.amount) * 100000000, // TODO review this line '* 100000000' convert satoshi to BTC sendMax: this.navParams.data.useSendMax == 'true' ? true : false, toAddress: this.navParams.data.address, description: this.navParams.data.description, @@ -559,7 +559,7 @@ export class ConfirmPage { let okText = 'Confirm'; // TODO gettextCatalog let cancelText = 'Cancel'; // TODO gettextCatalog this.popupProvider.ionicConfirm(null, message, okText, cancelText).then((ok: boolean) => { - return reject(!ok); + return resolve(!ok); }); }); }; @@ -580,18 +580,21 @@ export class ConfirmPage { txid: txp.txid }); } + this.onSuccessConfirm(); // TODO review this line }).catch((err: any) => { this.setSendError(err); return; }); }; - confirmTx().then(() => { - publishAndSign(); - }).catch((nok: boolean) => { + confirmTx().then((nok: boolean) => { if (nok) { this.sendStatus = ''; + return; } + publishAndSign(); + }).catch((err: any) => { + this.logger.warn(err); return; }); }).catch((err: any) => { diff --git a/src/providers/tx-confirm-notification/tx-confirm-notification.ts b/src/providers/tx-confirm-notification/tx-confirm-notification.ts index e97b66e69..54edfeab7 100644 --- a/src/providers/tx-confirm-notification/tx-confirm-notification.ts +++ b/src/providers/tx-confirm-notification/tx-confirm-notification.ts @@ -16,36 +16,32 @@ export class TxConfirmNotificationProvider { public checkIfEnabled(txid: string): Promise { return new Promise((resolve, reject) => { - this.persistenceProvider.getTxConfirmNotification(txid).then((res: any) => { - return resolve(!!res); - }).catch((err: any) => { - this.logger.error(err); - return reject(err); + this.persistenceProvider.getTxConfirmNotification(txid).then((res: any) => { + return resolve(!!res); + }).catch((err: any) => { + this.logger.error(err); + return reject(err); + }); }); - }); }; public subscribe(client: any, opts: any): void { - client.txConfirmationSubscribe(opts).then((res: any) => { + client.txConfirmationSubscribe(opts, (err: any, res: any) => { + if (err) this.logger.error(err); this.persistenceProvider.setTxConfirmNotification(opts.txid, true).catch((err: any) => { - this.logger.error(err); - return; - }); - }).catch((err: any) => { - this.logger.error(err); - return; + this.logger.error(err); + return; + }); }); }; public unsubscribe(client: any, txId: string): void { - client.txConfirmationUnsubscribe(txId).then((res: any) => { + client.txConfirmationUnsubscribe(txId, (err: any, res: any) => { + if (err) this.logger.error(err); this.persistenceProvider.removeTxConfirmNotification(txId).catch((err: any) => { - this.logger.error(err); - return; - }); - }).catch((err: any) => { - this.logger.error(err); - return; + this.logger.error(err); + return; + }); }); };