Show contact if exist on tx list
This commit is contained in:
parent
9b19f7b4ba
commit
dc21ac2a8c
2 changed files with 11 additions and 5 deletions
|
|
@ -113,10 +113,13 @@ angular.module('copayApp.directives')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.directive('contact', ['addressbookService', 'lodash',
|
.directive('contact', ['addressbookService', 'lodash', 'gettextCatalog',
|
||||||
function(addressbookService, lodash) {
|
function(addressbookService, lodash, gettextCatalog) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
|
scope: {
|
||||||
|
label: '='
|
||||||
|
},
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
var addr = attrs.address;
|
var addr = attrs.address;
|
||||||
addressbookService.get(addr, function(err, ab) {
|
addressbookService.get(addr, function(err, ab) {
|
||||||
|
|
@ -124,7 +127,11 @@ angular.module('copayApp.directives')
|
||||||
var name = lodash.isObject(ab) ? ab.name : ab;
|
var name = lodash.isObject(ab) ? ab.name : ab;
|
||||||
element.append(name);
|
element.append(name);
|
||||||
} else {
|
} else {
|
||||||
element.append(addr);
|
if (scope.label && scope.label == 'Sent') {
|
||||||
|
element.append(gettextCatalog.getString('Sent'));
|
||||||
|
} else {
|
||||||
|
element.append(addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,8 +161,7 @@
|
||||||
<span class="ellipsis">
|
<span class="ellipsis">
|
||||||
<div ng-if="btx.message">{{btx.message}}</div>
|
<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">{{btx.note.body}}</div>
|
||||||
<div ng-if="!btx.message && !btx.note.body && wallet.addressbook[btx.addressTo]">{{wallet.addressbook[btx.addressTo]}}</div>
|
<contact ng-if="!btx.message && !btx.note.body" class="ellipsis" address="{{btx.addressTo}}" label="'Sent'"></contact>
|
||||||
<div ng-if="!btx.message && !btx.note.body && !wallet.addressbook[btx.addressTo]" translate> Sent</div>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue