Support new proposals with array of outputs
This commit is contained in:
parent
5dec3249d1
commit
9cc275af5f
2 changed files with 2 additions and 3 deletions
|
|
@ -517,7 +517,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
message: 'test multi-output',
|
message: 'test multi-output',
|
||||||
fee: 1000,
|
fee: 1000,
|
||||||
createdOn: new Date() / 1000,
|
createdOn: new Date() / 1000,
|
||||||
type: 'multiple_output',
|
|
||||||
outputs: []
|
outputs: []
|
||||||
};
|
};
|
||||||
function addOutput(n) {
|
function addOutput(n) {
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,10 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
||||||
|
|
||||||
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
|
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
|
||||||
if (outputs && tx.action != 'received') {
|
if (outputs && tx.action != 'received') {
|
||||||
if ((tx.type && tx.type == 'multiple_output') || (tx.proposalType && tx.proposalType == 'multiple_output')) {
|
if (outputs > 1) {
|
||||||
tx.hasMultiplesOutputs = true;
|
tx.hasMultiplesOutputs = true;
|
||||||
tx.recipientCount = outputs;
|
tx.recipientCount = outputs;
|
||||||
}
|
}
|
||||||
tx.toAddress = tx.outputs[0].toAddress;
|
|
||||||
tx.amount = lodash.reduce(tx.outputs, function(total, o) {
|
tx.amount = lodash.reduce(tx.outputs, function(total, o) {
|
||||||
o.amountStr = formatAmountStr(o.amount);
|
o.amountStr = formatAmountStr(o.amount);
|
||||||
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
||||||
|
|
@ -38,6 +37,7 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tx.toAddress = tx.outputs[0].toAddress; // Get first address for single transactions
|
||||||
tx.amountStr = formatAmountStr(tx.amount);
|
tx.amountStr = formatAmountStr(tx.amount);
|
||||||
tx.alternativeAmountStr = formatAlternativeStr(tx.amount);
|
tx.alternativeAmountStr = formatAlternativeStr(tx.amount);
|
||||||
tx.feeStr = formatFeeStr(tx.fee || tx.fees);
|
tx.feeStr = formatFeeStr(tx.fee || tx.fees);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue