Coinbase connection issues and logout from tab-setting

This commit is contained in:
Gustavo Maximiliano Cortez 2016-12-08 13:06:01 -03:00
commit 539583a2af
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
9 changed files with 130 additions and 127 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, appConfigService, $ionicModal, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService, storageService, glideraService, gettextCatalog) {
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, appConfigService, $window, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService, storageService, glideraService, coinbaseService, gettextCatalog) {
var updateConfig = function() {
var isCordova = platformInfo.isCordova;
@ -26,6 +26,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbase.enabled && !isWindowsPhoneApp;
if ($scope.bitpayCardEnabled) {
bitpayCardService.getBitpayDebitCards(function(err, cards) {
@ -41,6 +42,14 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
});
}
if ($scope.coinbaseEnabled) {
coinbaseService.setCredentials();
storageService.getCoinbaseToken(coinbaseService.getEnvironment(), function(err, token) {
if (err) $log.error(err);
$scope.coinbaseToken = token;
});
}
});
};