mirror of https://github.com/BTCPrivate/copay.git
fix paypro
This commit is contained in:
parent
54b554d279
commit
13b8b81e11
|
@ -22,8 +22,16 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
var isCordova = platformInfo.isCordova;
|
||||
|
||||
|
||||
function refresh() {
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
}
|
||||
|
||||
|
||||
$scope.showWalletSelector = function() {
|
||||
$scope.walletSelector = true;
|
||||
refresh();
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function(event, data) {
|
||||
|
@ -133,12 +141,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
// Other Scope vars
|
||||
$scope.isCordova = isCordova;
|
||||
$scope.showAddress = false;
|
||||
$scope.paymentExpired = {
|
||||
value: false
|
||||
};
|
||||
$scope.remainingTimeStr = {
|
||||
value: null
|
||||
};
|
||||
|
||||
updateTx(tx, null, {}, function() {
|
||||
|
||||
$scope.walletSelectorTitle = gettextCatalog.getString('Send from');
|
||||
|
||||
|
@ -153,6 +157,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
setWallet($scope.wallets[0], tx);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -226,12 +232,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
$scope.tx = tx;
|
||||
|
||||
function refresh() {
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 1);
|
||||
}
|
||||
|
||||
function updateAmount() {
|
||||
if (!tx.toAmount) return;
|
||||
|
||||
|
@ -253,6 +253,10 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
tx.feeRate = feeRate;
|
||||
tx.feeLevelName = feeService.feeOpts[tx.feeLevel];
|
||||
|
||||
// End of quick refresh, before wallet is selected.
|
||||
if (!wallet)
|
||||
return cb();
|
||||
|
||||
getSendMaxInfo(lodash.clone(tx), wallet, function(err, sendMaxInfo) {
|
||||
if (err) {
|
||||
var msg = gettextCatalog.getString('Error getting SendMax information');
|
||||
|
@ -397,7 +401,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
};
|
||||
|
||||
function _paymentTimeControl(expirationTime) {
|
||||
$scope.paymentExpired.value = false;
|
||||
$scope.paymentExpired = false;
|
||||
setExpirationTime();
|
||||
|
||||
countDown = $interval(function() {
|
||||
|
@ -415,12 +419,12 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
var totalSecs = expirationTime - now;
|
||||
var m = Math.floor(totalSecs / 60);
|
||||
var s = totalSecs % 60;
|
||||
$scope.remainingTimeStr.value = ('0' + m).slice(-2) + ":" + ('0' + s).slice(-2);
|
||||
$scope.remainingTimeStr = ('0' + m).slice(-2) + ":" + ('0' + s).slice(-2);
|
||||
};
|
||||
|
||||
function setExpiredValues() {
|
||||
$scope.paymentExpired.value = true;
|
||||
$scope.remainingTimeStr.value = gettextCatalog.getString('Expired');
|
||||
$scope.paymentExpired = true;
|
||||
$scope.remainingTimeStr = gettextCatalog.getString('Expired');
|
||||
if (countDown) $interval.cancel(countDown);
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
|
@ -436,9 +440,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
setButtonText(wallet.credentials.m > 1, !!tx.paypro);
|
||||
|
||||
//T TODO
|
||||
if ($scope.paypro)
|
||||
_paymentTimeControl($scope.paypro.expires);
|
||||
if (tx.paypro)
|
||||
_paymentTimeControl(tx.paypro.expires);
|
||||
|
||||
updateTx(tx, wallet, {
|
||||
dryRun: true
|
||||
|
@ -477,8 +480,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
if (!tx || !wallet) return;
|
||||
|
||||
// TODO
|
||||
if (tx.paypro && $scope.paymentExpired.value) {
|
||||
if ($scope.paymentExpired) {
|
||||
popupService.showAlert(null, gettextCatalog.getString('This bitcoin payment request has expired.'));
|
||||
$scope.sendStatus = '';
|
||||
$timeout(function() {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
<div class="info">
|
||||
<div class="item single-line" ng-if="tx.paypro">
|
||||
<span class="label" translate>Payment Expires:</span>
|
||||
<span class="item-note" ng-if="!paymentExpired.value">{{remainingTimeStr.value}}</span>
|
||||
<span class="item-note" ng-if="paymentExpired.value" ng-style="{'color': 'red'}" translate>Expired</span>
|
||||
<span class="item-note" ng-if="!paymentExpired">{{remainingTimeStr}}</span>
|
||||
<span class="item-note" ng-if="paymentExpired" ng-style="{'color': 'red'}" translate>Expired</span>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
|
@ -61,7 +61,7 @@
|
|||
<span ng-if="tx.toName && showAddress">{{tx.toAddress}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="item item-icon-right" ng-hide="!tx.sendMax ||!wallet" ng-click="showWalletSelector()">
|
||||
<a class="item item-icon-right" ng-hide="!wallets" ng-click="showWalletSelector()">
|
||||
<span class="label" translate>From</span>
|
||||
<div class="wallet" ng-if="wallet">
|
||||
<i class="icon big-icon-svg">
|
||||
|
@ -92,7 +92,7 @@
|
|||
</span>
|
||||
<i class="icon bp-arrow-right"></i>
|
||||
</a>
|
||||
<div class="text-center" ng-show="!wallet">
|
||||
<div class="text-center" ng-show="noWalletMessage">
|
||||
<span class="badge badge-energized">{{noWalletMessage}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue