Enable input in bits/BTC to reload the debit card

This commit is contained in:
Gustavo Maximiliano Cortez 2017-03-27 11:31:46 -03:00
commit bc2d530e90
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
13 changed files with 84 additions and 101 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('buyCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService) {
angular.module('copayApp.controllers').controller('buyCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService, txFormatService) {
var amount;
var currency;
@ -34,8 +34,8 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isFiat = data.stateParams.currency ? true : false;
var parsedAmount = coinbaseService.parseAmount(
$scope.isFiat = data.stateParams.currency != 'bits' && data.stateParams.currency != 'BTC' ? true : false;
var parsedAmount = txFormatService.parseAmount(
data.stateParams.amount,
data.stateParams.currency);
@ -48,6 +48,11 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct
onlyComplete: true,
network: $scope.network
});
if (lodash.isEmpty($scope.wallets)) {
showErrorAndBack('No wallets available');
return;
}
$scope.wallet = $scope.wallets[0]; // Default first wallet
ongoingProcess.set('connectingCoinbase', true);