fix refresh in home / settings

This commit is contained in:
Matias Alejo Garcia 2017-01-30 19:38:52 -03:00
commit 5357ba7fcd
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
14 changed files with 150 additions and 96 deletions

View file

@ -0,0 +1,16 @@
'use strict';
angular.module('copayApp.controllers').controller('homeIntegrationsController', function($scope, homeIntegrationsService, $ionicScrollDelegate, $timeout) {
$scope.hide = false;
$scope.services = homeIntegrationsService.get();
$scope.toggle = function() {
$scope.hide = !$scope.hide;
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
};
});

View file

@ -16,7 +16,6 @@ angular.module('copayApp.controllers').controller('preferencesCoinbaseController
};
$scope.$on("$ionicView.enter", function(event, data){
coinbaseService.setCredentials();
ongoingProcess.set('connectingCoinbase', true);
coinbaseService.init(function(err, data) {
if (err || lodash.isEmpty(data)) {

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('tabHomeController',
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, bitpayCardService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService) {
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, bitpayCardService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService) {
var wallet;
var listeners = [];
var notifications = [];
@ -96,8 +96,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.nextStepsItems = nextStepsService.get();
$scope.buyAndSellItems = buyAndSellService.getLinked();
console.log('[tab-home.js.99]', $scope.buyAndSellItems); //TODO
$scope.homeIntegrations = homeIntegrationsService.get();
configService.whenAvailable(function() {
var config = configService.getSync();

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, appConfigService, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService, storageService, glideraService, coinbaseService, gettextCatalog) {
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, appConfigService, $log, lodash, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService, bitpayCardService, storageService, glideraService, coinbaseService, gettextCatalog, buyAndSellService) {
var updateConfig = function() {
var isCordova = platformInfo.isCordova;
@ -16,6 +16,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
$scope.currentFeeLevel = feeService.getCurrentFeeLevel();
$scope.wallets = profileService.getWallets();
$scope.buyAndSellServices = buyAndSellService.getLinked();
configService.whenAvailable(function(config) {
$scope.unitName = config.wallet.settings.unitName;
@ -25,8 +26,6 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
};
$scope.bitpayCardEnabled = config.bitpayCard.enabled;
$scope.glideraEnabled = config.glidera.enabled && !isWindowsPhoneApp;
$scope.coinbaseEnabled = config.coinbaseV2 && !isWindowsPhoneApp;
if ($scope.bitpayCardEnabled) {
bitpayCardService.getCards(function(err, cards) {
@ -35,20 +34,6 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
});
}
if ($scope.glideraEnabled) {
storageService.getGlideraToken(glideraService.getEnvironment(), function(err, token) {
if (err) $log.error(err);
$scope.glideraToken = token;
});
}
if ($scope.coinbaseEnabled) {
coinbaseService.setCredentials();
coinbaseService.getStoredToken(function(at) {
$scope.coinbaseToken = at;
});
}
});
};