Input type number. Fix empty gift cards list
This commit is contained in:
parent
02334320d0
commit
210bbc36cc
6 changed files with 33 additions and 45 deletions
|
|
@ -5,10 +5,10 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
|
||||
var self = this;
|
||||
var client;
|
||||
var minimumAmount = 5;
|
||||
var stepAmount = 1;
|
||||
var multiplierAmount = 5;
|
||||
var maximumAmount = 500;
|
||||
var limitsAllowed = {
|
||||
min: 0.01,
|
||||
max: 2000
|
||||
};
|
||||
|
||||
var handleEncryptedWallet = function(client, cb) {
|
||||
if (!walletService.isEncrypted(client)) return cb();
|
||||
|
|
@ -19,7 +19,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
};
|
||||
|
||||
this.init = function() {
|
||||
$scope.fiat = minimumAmount;
|
||||
var network = configService.getSync().amazon.testnet ? 'testnet' : 'livenet';
|
||||
amazonService.setCredentials(network);
|
||||
amazonService.healthCheckRequest();
|
||||
|
|
@ -35,6 +34,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
}
|
||||
};
|
||||
|
||||
this.checkLimits = function() {
|
||||
console.log('[buyAmazon.js:37]'); //TODO
|
||||
if ($scope.fiat && $scope.fiat >= limitsAllowed.min && $scope.fiat <= limitsAllowed.max)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
$scope.openWalletsModal = function(wallets) {
|
||||
self.error = null;
|
||||
|
||||
|
|
@ -59,16 +66,6 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
});
|
||||
};
|
||||
|
||||
this.setAmount = function(plus) {
|
||||
if (plus && $scope.fiat < maximumAmount ) {
|
||||
stepAmount = stepAmount + 1;
|
||||
$scope.fiat = stepAmount * multiplierAmount;
|
||||
} else if (!plus && $scope.fiat > minimumAmount) {
|
||||
stepAmount = stepAmount - 1;
|
||||
$scope.fiat = stepAmount * multiplierAmount;
|
||||
}
|
||||
};
|
||||
|
||||
this.createTx = function() {
|
||||
self.error = null;
|
||||
self.errorInfo = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue