check last signer

This commit is contained in:
JDonadio 2017-01-16 17:12:55 -03:00
commit 10315d13b8
2 changed files with 12 additions and 28 deletions

View file

@ -59,21 +59,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
function applyButtonText(multisig) { function applyButtonText(multisig) {
$scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
if ($scope.paypro) {
$scope.buttonText += gettextCatalog.getString('to pay');
return;
}
if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) { if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) {
$scope.buttonText += gettextCatalog.getString('to complete'); $scope.buttonText += gettextCatalog.getString('to complete');
return; } else if ($scope.paypro) {
} $scope.buttonText += gettextCatalog.getString('to pay');
} else if (multisig) {
if (multisig) {
$scope.buttonText += gettextCatalog.getString('to accept'); $scope.buttonText += gettextCatalog.getString('to accept');
return; } else
}
$scope.buttonText += gettextCatalog.getString('to send'); $scope.buttonText += gettextCatalog.getString('to send');
}; };

View file

@ -22,25 +22,17 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
applyButtonText(); applyButtonText();
}; };
function applyButtonText(multisig) { function applyButtonText() {
$scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
if ($scope.paypro) { var lastSigner = lodash.filter($scope.tx.actions, {
$scope.buttonText += gettextCatalog.getString('to pay'); type: 'accept'
return; }).length == $scope.tx.requiredSignatures - 1;
}
if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) {
$scope.buttonText += gettextCatalog.getString('to complete');
return;
}
if (multisig) {
$scope.buttonText += gettextCatalog.getString('to accept');
return;
}
if (lastSigner)
$scope.buttonText += gettextCatalog.getString('to send'); $scope.buttonText += gettextCatalog.getString('to send');
else
$scope.buttonText += gettextCatalog.getString('to accept');
}; };
function getDisplayAmount(amountStr) { function getDisplayAmount(amountStr) {