diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index 0cfd503ab..9ebcf507f 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -53,8 +53,22 @@ angular.module('copayApp.controllers').controller('confirmController', function( else $scope.network = (new bitcore.Address($scope.toAddress)).network.name; resetValues(); setwallets(); + applyButtonText(); }); + function applyButtonText(multisig) { + $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; + + if ($scope.isGlidera || $scope.isGiftCard || $scope.cardId) { + $scope.buttonText += gettextCatalog.getString('to complete'); + } else if ($scope.paypro) { + $scope.buttonText += gettextCatalog.getString('to pay'); + } else if (multisig) { + $scope.buttonText += gettextCatalog.getString('to accept'); + } else + $scope.buttonText += gettextCatalog.getString('to send'); + }; + function setwallets() { $scope.wallets = profileService.getWallets({ onlyComplete: true, @@ -285,6 +299,8 @@ angular.module('copayApp.controllers').controller('confirmController', function( $scope.getSendMaxInfo(); } else setWallet(wallet); + + applyButtonText(wallet.credentials.m > 1); }; $scope.showDescriptionPopup = function() { diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js index 692b21a6f..5c58d3447 100644 --- a/src/js/controllers/modals/txpDetails.js +++ b/src/js/controllers/modals/txpDetails.js @@ -19,15 +19,29 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi $scope.displayUnit = getDisplayUnit($scope.tx.amountStr); initActionList(); checkPaypro(); - } + applyButtonText(); + }; + + function applyButtonText() { + $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' '; + + var lastSigner = lodash.filter($scope.tx.actions, { + type: 'accept' + }).length == $scope.tx.requiredSignatures - 1; + + if (lastSigner) + $scope.buttonText += gettextCatalog.getString('to send'); + else + $scope.buttonText += gettextCatalog.getString('to accept'); + }; function getDisplayAmount(amountStr) { return amountStr.split(' ')[0]; - } + }; function getDisplayUnit(amountStr) { return amountStr.split(' ')[1]; - } + }; function initActionList() { $scope.actionList = []; diff --git a/www/views/confirm.html b/www/views/confirm.html index 8ad43e6f2..9612e42dc 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -131,17 +131,16 @@ has-wallet-chosen="wallet" insufficient-funds="insufficientFunds" no-matching-wallet="noMatchingWallet"> - {{'Accept' | translate}} + {{buttonText}} - {{'Accept' | translate}} + {{buttonText}} -
+ ng-touchstart="onTouchstart($event)" + ng-touchmove="onTouchmove($event)" + ng-touchend="onTouchend($event)" + ng-mousedown="onTouchstart($event)" + ng-mousemove="onTouchmove($event)" + ng-mouseup="onTouchend($event)"> +
-
+
-
+
-
+
{{displaySendStatus}}
diff --git a/www/views/modals/txp-details.html b/www/views/modals/txp-details.html index f437cede2..a37cdc7b7 100644 --- a/www/views/modals/txp-details.html +++ b/www/views/modals/txp-details.html @@ -166,19 +166,18 @@ ng-if="tx.pendingForUs && canSign && !paymentExpired && hasClick" click-send-status="sendStatus" has-wallet-chosen="true"> - {{'Accept'| translate}} + {{buttonText}} - {{'Accept'| translate}} + {{buttonText}} + slide-success-on-confirm="onSuccessConfirm()"> {{'Payment Sent' | translate}}