on sent screen show both cashaddr and legacy address for bch

This commit is contained in:
Kadir Sekha 2018-01-31 11:03:18 -04:00
commit f7c95c531e
2 changed files with 14 additions and 5 deletions

View file

@ -123,13 +123,13 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
if ($scope.wallet.coin == 'bch' && txDate >= cashaddrDate) {
var bchAddresses = bitcoinCashJsService.translateAddresses($scope.btx.addressTo);
$scope.btx.displayAddress = bchAddresses.cashaddr;
$scope.btx.copyAddress = 'bitcoincash:' + $scope.btx.displayAddress;
} else {
$scope.btx.displayAddress = $scope.btx.addressTo;
$scope.btx.copyAddress = $scope.btx.displayAddress;
$scope.btx.cashAddr = bchAddresses.cashaddr;
$scope.btx.cashCopyAddr = 'bitcoincash:' + $scope.btx.cashAddr;
}
$scope.btx.displayAddress = $scope.btx.addressTo;
$scope.btx.copyAddress = $scope.btx.displayAddress;
txFormatService.formatAlternativeStr($scope.wallet.coin, tx.fees, function(v) {
$scope.btx.feeFiatStr = v;
$scope.btx.feeRateStr = ($scope.btx.fees / ($scope.btx.amount + $scope.btx.fees) * 100).toFixed(2) + '%';

View file

@ -39,6 +39,14 @@
<div class="info">
<div class="item" ng-if="btx.action === 'sent'">
<span class="label" translate>To</span>
<span ng-if="btx.cashAddr" class="payment-proposal-to">
<img ng-if="!cardId" src="img/icon-bitcoin-small.svg">
<img ng-if="cardId" src="img/icon-card.svg" width="34">
<div copy-to-clipboard="btx.cashCopyAddr" class="elipsis">
<contact ng-if="!toName" address="{{btx.cashAddr}}" class="elipsis" style="display: block;"></contact>
<span class="m15l size-14" ng-if="toName">{{toName}}</span>
</div>
</span>
<span class="payment-proposal-to">
<img ng-if="!cardId" src="img/icon-bitcoin-small.svg">
<img ng-if="cardId" src="img/icon-card.svg" width="34">
@ -48,6 +56,7 @@
</div>
</span>
</div>
<div class="item">
<span class="label" ng-if="btx.action === 'sent'" translate>From</span>
<span class="label" ng-if="btx.action !== 'sent'" translate>To</span>