isolate change specific to action = received

This commit is contained in:
Gregg Zigler 2015-08-06 07:23:47 -07:00
commit 949550c35d
2 changed files with 15 additions and 12 deletions

View file

@ -30,18 +30,20 @@
<ul class="no-bullet size-14 m0">
<div ng-if="btx.action == 'received'">
<li class="line-b p10 oh">
<li class="line-b p10 oh" ng-if="btx.message">
<span class="text-gray" translate>Note</span>:
<span class="right">{{btx.message}}</span>
</li>
</div>
<div ng-if="!btx.showSingle && btx.action != 'received'"
ng-repeat="output in [ btx.outputs.summary ]"
ng-include="'views/includes/output.html'">
</div>
<div ng-if="!btx.showSingle && btx.outputs.summary.showDetails && btx.action != 'received'"
ng-repeat="output in btx.outputs.details"
ng-include="'views/includes/output.html'">
<div ng-if="btx.action != 'received'">
<div ng-if="!btx.showSingle"
ng-repeat="output in [ btx.outputs.summary ]"
ng-include="'views/includes/output.html'">
</div>
<div ng-if="!btx.showSingle && btx.outputs.summary.showDetails"
ng-repeat="output in btx.outputs.details"
ng-include="'views/includes/output.html'">
</div>
</div>
<li ng-if="btx.showSingle && btx.addressTo && btx.addressTo != 'N/A'" class="line-b p10 oh" ng-click="copyAddress(btx.addressTo)">
<span class="text-gray" translate>To</span>:

View file

@ -430,11 +430,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (tx.outputs) {
tx.showSingle = false;
tx.outputs.details = lodash.clone(tx.outputs);
var total = lodash.reduce(tx.outputs.details, function(total, o) {
formatAmount(o);
return total + o.amount;
}, 0);
if (tx.action != 'received') {
tx.amount = lodash.reduce(tx.outputs.details, function(total, o) {
formatAmount(o);
return total + o.amount;
}, 0);
tx.amount = total;
}
tx.outputs.summary = {
amount: tx.amount,