fix refresh in home / settings
This commit is contained in:
parent
d85da2cc45
commit
5357ba7fcd
14 changed files with 150 additions and 96 deletions
16
src/js/controllers/homeIntegrations.js
Normal file
16
src/js/controllers/homeIntegrations.js
Normal 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);
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue