disable send button if time is expired
This commit is contained in:
parent
bccadd8708
commit
a962e3a913
2 changed files with 6 additions and 3 deletions
|
|
@ -476,7 +476,7 @@
|
||||||
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
<div class="columns" ng-class="{'small-6 medium-6 large-6':(home._paypro || home.lockAddress || home.lockAmount)}">
|
||||||
<button type="submit" class="button black round expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline || home.paymentExpired"
|
<button type="submit" class="button black round expand" ng-disabled="sendForm.$invalid || home.blockUx || index.isOffline || (home.paymentExpired && home.usePaypro)"
|
||||||
ng-style="{'background-color':index.backgroundColor}" translate>
|
ng-style="{'background-color':index.backgroundColor}" translate>
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.addr = {};
|
this.addr = {};
|
||||||
this.lockedCurrentFeePerKb = null;
|
this.lockedCurrentFeePerKb = null;
|
||||||
self.paymentExpired = true;
|
self.paymentExpired = true;
|
||||||
|
self.usePaypro = false;
|
||||||
|
|
||||||
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
var disableScannerListener = $rootScope.$on('dataScanned', function(event, data) {
|
||||||
self.setForm(data);
|
self.setForm(data);
|
||||||
|
|
@ -949,6 +950,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.resetForm = function() {
|
this.resetForm = function() {
|
||||||
this.resetError();
|
this.resetError();
|
||||||
self.paymentExpired = true;
|
self.paymentExpired = true;
|
||||||
|
self.usePaypro = false;
|
||||||
this._paypro = null;
|
this._paypro = null;
|
||||||
this.lockedCurrentFeePerKb = null;
|
this.lockedCurrentFeePerKb = null;
|
||||||
|
|
||||||
|
|
@ -1068,9 +1070,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
|
|
||||||
function _countDownPaymentTime(time){
|
function _countDownPaymentTime(time){
|
||||||
|
self.usePaypro = true;
|
||||||
self.paymentExpired = false;
|
self.paymentExpired = false;
|
||||||
// self.timeToExpire = time;
|
self.timeToExpire = time;
|
||||||
self.timeToExpire = (Math.floor(Date.now()/1000) + 10);
|
// self.timeToExpire = (Math.floor(Date.now()/1000) + 10);
|
||||||
var countDown = $interval(function(){
|
var countDown = $interval(function(){
|
||||||
self.timeToExpire--;
|
self.timeToExpire--;
|
||||||
if(self.timeToExpire <= Math.floor(Date.now() / 1000)){
|
if(self.timeToExpire <= Math.floor(Date.now() / 1000)){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue