mirror of https://github.com/BTCPrivate/copay.git
Revert "fix remaining time paypro"
This commit is contained in:
parent
b1e385e247
commit
bd2b49dd46
|
@ -279,13 +279,13 @@
|
|||
<a class="text-gray size-12"
|
||||
ng-show="index.historyShowMore"
|
||||
ng-click="index.showMore()">
|
||||
<span translate>Show more</span>
|
||||
<span translate>Show more</span>
|
||||
<span ng-if="!index.isSearching">
|
||||
({{index.completeHistory.length - index.txHistory.length}})
|
||||
</span>
|
||||
</span>
|
||||
<span ng-if="index.isSearching">
|
||||
({{index.result.length - index.txHistorySearchResults.length}})
|
||||
</span>
|
||||
</span>
|
||||
<i class="icon-arrow-down4"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -394,7 +394,7 @@
|
|||
</a>
|
||||
<div ng-show="!home.paymentExpired && home._paypro">
|
||||
<span translate>Payment expires</span>
|
||||
<time>{{home.remainingTimeStr}}</time>
|
||||
<time> {{home.timeToExpire * 1000 | amTimeAgo}}</time>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="camera-icon" ng-show="index.isComplete">
|
||||
|
|
|
@ -1107,24 +1107,26 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
}, 1);
|
||||
};
|
||||
|
||||
function _paymentTimeControl(expirationTime) {
|
||||
var countDown;
|
||||
setEpirationTime();
|
||||
countDown = $interval(function() {
|
||||
setEpirationTime();
|
||||
}, 1000);
|
||||
function _paymentTimeControl(timeToExpire) {
|
||||
var now = Math.floor(Date.now() / 1000);
|
||||
|
||||
function setEpirationTime() {
|
||||
if (moment().isAfter(expirationTime * 1000)) {
|
||||
if (timeToExpire <= now) {
|
||||
setExpiredPaymentValues();
|
||||
return;
|
||||
}
|
||||
|
||||
self.timeToExpire = timeToExpire;
|
||||
var countDown = $interval(function() {
|
||||
if (self.timeToExpire <= now) {
|
||||
setExpiredPaymentValues();
|
||||
if (countDown) $interval.cancel(countDown);
|
||||
$interval.cancel(countDown);
|
||||
}
|
||||
self.remainingTimeStr = moment(expirationTime * 1000).fromNow();
|
||||
};
|
||||
self.timeToExpire--;
|
||||
}, 1000);
|
||||
|
||||
function setExpiredPaymentValues() {
|
||||
self.paymentExpired = true;
|
||||
self.remainingTimeStr = null;
|
||||
self.timeToExpire = null;
|
||||
self._paypro = null;
|
||||
self.error = gettext('Cannot sign: The payment request has expired');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue