disable send button if time is expired

This commit is contained in:
Javier 2016-02-04 13:25:35 -03:00
commit a962e3a913
2 changed files with 6 additions and 3 deletions

View file

@ -28,6 +28,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.addr = {};
this.lockedCurrentFeePerKb = null;
self.paymentExpired = true;
self.usePaypro = false;
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
self.setForm(data);
@ -949,6 +950,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.resetForm = function() {
this.resetError();
self.paymentExpired = true;
self.usePaypro = false;
this._paypro = null;
this.lockedCurrentFeePerKb = null;
@ -1068,9 +1070,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
};
function _countDownPaymentTime(time){
self.usePaypro = true;
self.paymentExpired = false;
// self.timeToExpire = time;
self.timeToExpire = (Math.floor(Date.now()/1000) + 10);
self.timeToExpire = time;
// self.timeToExpire = (Math.floor(Date.now()/1000) + 10);
var countDown = $interval(function(){
self.timeToExpire--;
if(self.timeToExpire <= Math.floor(Date.now() / 1000)){