Adds example. Refactory
This commit is contained in:
parent
8882ca8e87
commit
804c37bffa
2 changed files with 21 additions and 3 deletions
|
|
@ -24,10 +24,9 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
|||
root.processTx = function(tx) {
|
||||
if (!tx) return;
|
||||
|
||||
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
|
||||
if (outputs && tx.action != 'received') {
|
||||
if (lodash.isArray(tx.outputs) && tx.action != 'received') {
|
||||
tx.hasMultiplesOutputs = true;
|
||||
tx.recipientCount = outputs;
|
||||
tx.recipientCount = tx.outputs.length;
|
||||
tx.amount = lodash.reduce(tx.outputs, function(total, o) {
|
||||
o.amountStr = formatAmountStr(o.amount);
|
||||
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue