Skip to content

Commit f740db7

Browse files
authored
Merge pull request bitpay#654 from cmgustavo/bug/tx-details-copy-clipboard
Fix show contact name
2 parents 557b760 + ad9c840 commit f740db7

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

src/js/controllers/tab-home.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
angular.module('copayApp.controllers').controller('tabHomeController',
4-
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService) {
4+
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService, addressbookService) {
55
var wallet;
66
var listeners = [];
77
var notifications = [];
@@ -230,6 +230,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
230230
nextStep();
231231
updateAllWallets();
232232

233+
addressbookService.list(function(err, ab) {
234+
if (err) $log.error(err);
235+
$scope.addressbook = ab || {};
236+
});
237+
233238
listeners = [
234239
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
235240
var wallet = profileService.getWallet(walletId);

www/views/bitpayCard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</ion-nav-back-button>
55
<ion-nav-title>BitPay Visa<sup>&reg;</sup> Card</ion-nav-title>
66
<ion-nav-buttons side="secondary">
7-
<button class="button no-border" ng-show="!error" ui-sref="tabs.bitpayCard.preferences">
7+
<button class="button no-border" ui-sref="tabs.bitpayCard.preferences">
88
<i class="icon ion-ios-settings"></i>
99
</button>
1010
</ion-nav-buttons>

www/views/includes/txp.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{{tx.amountStr}}
55
</div>
66
<span ng-show="!tx.merchant">
7-
<span ng-show="addressbook[tx.toAddress] && !tx.message">
8-
{{addressbook[tx.toAddress]}}
7+
<span ng-show="addressbook[tx.toAddress] && addressbook[tx.toAddress].name && !tx.message">
8+
{{addressbook[tx.toAddress].name}}
99
</span>
1010
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
1111
{{tx.message}}
@@ -18,8 +18,6 @@
1818
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
1919
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
2020
</span>
21-
<span>
22-
</span>
2321

2422
<p class="wallet-activity-note">
2523
<i class="icon ion-record wallet-activity-note-child" ng-style="{'color':tx.wallet.color}"></i>

www/views/modals/tx-details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<span class="payment-proposal-to">
2626
<img ng-if="!cardId" src="img/icon-bitcoin-small.svg">
2727
<img ng-if="cardId" src="img/icon-card.svg" width="34">
28-
<div copy-to-clipboard="toAddress" class="ellipsis">
28+
<div copy-to-clipboard="btx.addressTo" class="ellipsis">
2929
<contact ng-if="!toName" address="{{btx.addressTo}}" class="ellipsis" style="display: block;"></contact>
3030
<span class="m15l size-14" ng-if="toName">{{toName}}</span>
3131
</div>

www/views/walletDetails.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@
158158
<div ng-show="btx.action == 'sent'" class="ellipsis">
159159
<div ng-if="btx.message">{{btx.message}}</div>
160160
<div ng-if="!btx.message && btx.note.body">{{btx.note.body}}</div>
161-
<div ng-if="!btx.message && !btx.note.body && addressbook[btx.addressTo]">
161+
<div ng-if="!btx.message && !btx.note.body && addressbook[btx.addressTo] && addressbook[btx.addressTo].name">
162162
{{addressbook[btx.addressTo].name}}
163163
</div>
164-
<div ng-if="!btx.message && !btx.note.body && !addressbook[btx.addressTo]" translate>Sent</div>
164+
<div ng-if="!btx.message && !btx.note.body && !(addressbook[btx.addressTo] && addressbook[btx.addressTo].name)" translate>Sent</div>
165165
</div>
166166

167167
<div ng-show="btx.action == 'moved'" class="ellipsis">

0 commit comments

Comments
 (0)