diff --git a/public/views/walletHome.html b/public/views/walletHome.html
index 36464ef0e..dc3e4875a 100644
--- a/public/views/walletHome.html
+++ b/public/views/walletHome.html
@@ -279,13 +279,13 @@
- Show more
+ Show more
({{index.completeHistory.length - index.txHistory.length}})
-
+
({{index.result.length - index.txHistorySearchResults.length}})
-
+
@@ -394,7 +394,7 @@
Payment expires
-
+
diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js
index daf824b2e..0cf5c7cc9 100644
--- a/src/js/controllers/walletHome.js
+++ b/src/js/controllers/walletHome.js
@@ -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');
};