Input type number. Fix empty gift cards list

This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-14 00:36:41 -03:00
commit 210bbc36cc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
6 changed files with 33 additions and 45 deletions

View file

@ -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;