Merge pull request #654 from cmgustavo/bug/tx-details-copy-clipboard

Fix show contact name
This commit is contained in:
Matias Alejo Garcia 2016-10-23 20:18:31 -03:00 committed by GitHub
commit f740db7e39
5 changed files with 12 additions and 9 deletions

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService) {
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, gettextCatalog, lodash, popupService, ongoingProcess, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, $window, bitpayCardService, startupService, addressbookService) {
var wallet;
var listeners = [];
var notifications = [];
@ -230,6 +230,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
nextStep();
updateAllWallets();
addressbookService.list(function(err, ab) {
if (err) $log.error(err);
$scope.addressbook = ab || {};
});
listeners = [
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
var wallet = profileService.getWallet(walletId);

View File

@ -4,7 +4,7 @@
</ion-nav-back-button>
<ion-nav-title>BitPay Visa<sup>&reg;</sup> Card</ion-nav-title>
<ion-nav-buttons side="secondary">
<button class="button no-border" ng-show="!error" ui-sref="tabs.bitpayCard.preferences">
<button class="button no-border" ui-sref="tabs.bitpayCard.preferences">
<i class="icon ion-ios-settings"></i>
</button>
</ion-nav-buttons>

View File

@ -4,8 +4,8 @@
{{tx.amountStr}}
</div>
<span ng-show="!tx.merchant">
<span ng-show="addressbook[tx.toAddress] && !tx.message">
{{addressbook[tx.toAddress]}}
<span ng-show="addressbook[tx.toAddress] && addressbook[tx.toAddress].name && !tx.message">
{{addressbook[tx.toAddress].name}}
</span>
<span class="ellipsis" ng-show="!addressbook[tx.toAddress] && tx.message">
{{tx.message}}
@ -18,8 +18,6 @@
<span ng-show="tx.merchant.pr.ca"><i class="fi-lock"></i> {{tx.merchant.domain}}</span>
<span ng-show="!tx.merchant.pr.ca"><i class="fi-unlock"></i> {{tx.merchant.domain}}</span>
</span>
<span>
</span>
<p class="wallet-activity-note">
<i class="icon ion-record wallet-activity-note-child" ng-style="{'color':tx.wallet.color}"></i>

View File

@ -25,7 +25,7 @@
<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">
<div copy-to-clipboard="toAddress" class="ellipsis">
<div copy-to-clipboard="btx.addressTo" class="ellipsis">
<contact ng-if="!toName" address="{{btx.addressTo}}" class="ellipsis" style="display: block;"></contact>
<span class="m15l size-14" ng-if="toName">{{toName}}</span>
</div>

View File

@ -158,10 +158,10 @@
<div ng-show="btx.action == 'sent'" class="ellipsis">
<div ng-if="btx.message">{{btx.message}}</div>
<div ng-if="!btx.message && btx.note.body">{{btx.note.body}}</div>
<div ng-if="!btx.message && !btx.note.body && addressbook[btx.addressTo]">
<div ng-if="!btx.message && !btx.note.body && addressbook[btx.addressTo] && addressbook[btx.addressTo].name">
{{addressbook[btx.addressTo].name}}
</div>
<div ng-if="!btx.message && !btx.note.body && !addressbook[btx.addressTo]" translate>Sent</div>
<div ng-if="!btx.message && !btx.note.body && !(addressbook[btx.addressTo] && addressbook[btx.addressTo].name)" translate>Sent</div>
</div>
<div ng-show="btx.action == 'moved'" class="ellipsis">