mirror of https://github.com/BTCPrivate/copay.git
apply timer in proposal details
This commit is contained in:
parent
5ddecd0e66
commit
6f464b8009
|
@ -355,11 +355,16 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
function setExpirationTime() {
|
function setExpirationTime() {
|
||||||
if (moment().isAfter(expirationTime * 1000)) {
|
var now = Math.floor(Date.now() / 1000);
|
||||||
|
if (now > expirationTime) {
|
||||||
$scope.paymentExpired = true;
|
$scope.paymentExpired = true;
|
||||||
if (self.countDown) $interval.cancel(self.countDown);
|
if (self.countDown) $interval.cancel(self.countDown);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
$scope.expires = moment(expirationTime * 1000).fromNow();
|
var totalSecs = expirationTime - now;
|
||||||
|
var m = Math.floor(totalSecs / 60);
|
||||||
|
var s = totalSecs % 60;
|
||||||
|
$scope.expires = ('0' + m).slice(-2) + ":" + ('0' + s).slice(-2);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue