From bba58e96d96ca4baa46323cc09b50064c8f177c8 Mon Sep 17 00:00:00 2001 From: Gabriel Masclef Date: Wed, 7 Feb 2018 15:29:45 -0300 Subject: [PATCH] Fix: memo, message and addressbook contacts fixed in txDetails and wallet history --- .../buy-mercado-libre/buy-mercado-libre.ts | 2 +- src/pages/tx-details/tx-details.html | 11 +- src/pages/tx-details/tx-details.ts | 6 +- src/pages/wallet-details/wallet-details.html | 133 +++++++++++------- src/pages/wallet-details/wallet-details.scss | 6 +- 5 files changed, 95 insertions(+), 63 deletions(-) diff --git a/src/pages/integrations/mercado-libre/buy-mercado-libre/buy-mercado-libre.ts b/src/pages/integrations/mercado-libre/buy-mercado-libre/buy-mercado-libre.ts index 73fc94ad1..2bec499ce 100644 --- a/src/pages/integrations/mercado-libre/buy-mercado-libre/buy-mercado-libre.ts +++ b/src/pages/integrations/mercado-libre/buy-mercado-libre/buy-mercado-libre.ts @@ -325,7 +325,7 @@ export class BuyMercadoLibrePage { invoice['buyerPaidBtcMinerFee'] = invoice.buyerPaidBtcMinerFee || 0; let invoiceFeeSat = parseInt((invoice.buyerPaidBtcMinerFee * 100000000).toFixed()); - this.message = this.amountUnitStr + " for Mercado Livre Brazil Gift Car"; // TODO: translate + this.message = this.amountUnitStr + " for Mercado Livre Brazil Gift Card"; // TODO: translate this.createTx(wallet, invoice, this.message).then((ctxp: any) => { this.onGoingProcessProvider.set('loadingTxInfo', false); diff --git a/src/pages/tx-details/tx-details.html b/src/pages/tx-details/tx-details.html index 9c85ce8c2..03e7814bf 100644 --- a/src/pages/tx-details/tx-details.html +++ b/src/pages/tx-details/tx-details.html @@ -43,8 +43,8 @@ -
- {{ btx.addressTo }}" +
+ {{ btx.outputs[0].address }}" {{ toName }}
@@ -80,8 +80,9 @@ @@ -159,4 +160,4 @@ - + \ No newline at end of file diff --git a/src/pages/tx-details/tx-details.ts b/src/pages/tx-details/tx-details.ts index c89a9186d..dedf63ee9 100644 --- a/src/pages/tx-details/tx-details.ts +++ b/src/pages/tx-details/tx-details.ts @@ -101,8 +101,8 @@ export class TxDetailsPage { } private updateMemo(): void { - this.walletProvider.getTxNote(this.wallet, this.btx.txid).then((note: string) => { - if (!note) return; + this.walletProvider.getTxNote(this.wallet, this.btx.txid).then((note: any) => { + if (!note || note.body == "") return; this.btx.note = note; }).catch((err: any) => { this.logger.warn('Could not fetch transaction note: ' + err); @@ -194,7 +194,7 @@ export class TxDetailsPage { if (this.btx.note && this.btx.note.body) opts.defaultText = this.btx.note.body; this.popupProvider.ionicPrompt(this.wallet.name, this.translate.instant('Memo'), opts).then((text: string) => { - if (typeof text == "undefined") return; + if (text == null) return; this.btx.note = { body: text diff --git a/src/pages/wallet-details/wallet-details.html b/src/pages/wallet-details/wallet-details.html index a39f7fb40..49d151104 100644 --- a/src/pages/wallet-details/wallet-details.html +++ b/src/pages/wallet-details/wallet-details.html @@ -7,64 +7,63 @@
-
-
-
-
{{wallet.status.totalBalanceStr}}
-
- {{wallet.status.totalBalanceAlternative}} {{wallet.status.alternativeIsoCode}} -
-
- -
- [Balance Hidden] -
- Tap and hold to show -
+
+
+
+
{{wallet.status.totalBalanceStr}}
+
+ {{wallet.status.totalBalanceAlternative}} {{wallet.status.alternativeIsoCode}}
-
- [Scanning Funds] -
- -
-
Spendable
- - {{wallet.status.spendableBalanceStr}} - -   - - ({{wallet.status.spendableBalanceAlternative}} {{wallet.status.alternativeIsoCode}}) - -
- -
- {{updateStatusError}}. Tap to retry -
-
- This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it - from the local information. Tap to recreate +
+ [Balance Hidden] +
+ Tap and hold to show +
-
- +
+ [Scanning Funds] +
- - - - - - - - - {{wallet.m}}-of-{{wallet.n}} +
+
Spendable
+ + {{wallet.status.spendableBalanceStr}} + +   + + ({{wallet.status.spendableBalanceAlternative}} {{wallet.status.alternativeIsoCode}})
+
+ {{updateStatusError}}. + Tap to retry +
+
+ This wallet is not registered at the given Bitcore Wallet Service (BWS). You can recreate it from the local information. + Tap to recreate +
+
+ +
+ + + + + + + + + + + {{wallet.m}}-of-{{wallet.n}} + +
+
@@ -143,12 +142,40 @@
-
{{'Sending' | translate}}
-
{{'Receiving' | translate}}
-
{{tx.action}}
+ +
+ {{'Sending' | translate}} + {{addressbook[tx.outputs[0].address].name || addressbook[tx.outputs[0].address]}} + {{'Receiving' | translate}} +
+ +
+ {{'Received' | translate}} + {{tx.note.body}} +
+ +
+ {{'Sent' | translate}} + {{tx.message}} + {{tx.note.body}} + + {{addressbook[tx.outputs[0].address].name || addressbook[tx.outputs[0].address]}} + +
+ +
+ {{'Moved' | translate}} + {{tx.note.body}} +
+ +
+ {{'Invalid' | translate}} +
+
- {{tx.amount | satToUnit: wallet.coin}} + {{tx.amount | satToUnit: wallet.coin}} + (possible double spend)
{{tx.time * 1000 | amTimeAgo}} @@ -162,4 +189,4 @@ - + \ No newline at end of file diff --git a/src/pages/wallet-details/wallet-details.scss b/src/pages/wallet-details/wallet-details.scss index 664d52def..154d9895f 100644 --- a/src/pages/wallet-details/wallet-details.scss +++ b/src/pages/wallet-details/wallet-details.scss @@ -43,6 +43,10 @@ page-wallet-details { width: 35px; } .action { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } ion-note { text-align: end; @@ -121,7 +125,7 @@ page-wallet-details { .total-locked-amount { color: color($colors, dark); } - .total-alt-locked-amount { + .total-alt-locked-amount, .double-spend { font-size: 12.5px; } }