Merge pull request #4930 from gabrielbazan7/fix/nextSteps

fix next steps
This commit is contained in:
Matias Alejo Garcia 2016-10-27 12:35:56 -03:00 committed by GitHub
commit 070ce0470a

View file

@ -197,13 +197,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}); });
}; };
var nextStep = function() { var nextStep = function(cb) {
lodash.each(['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'], function(service) { var i = 0;
var services = ['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'];
lodash.each(services, function(service) {
storageService.getNextStep(service, function(err, value) { storageService.getNextStep(service, function(err, value) {
$scope.externalServices[service] = value ? true : false; $scope.externalServices[service] = value ? true : false;
$timeout(function() { if (++i == services.length) return cb();
$ionicScrollDelegate.resize();
}, 10);
}); });
}); });
}; };
@ -243,7 +243,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}; };
$scope.$on("$ionicView.enter", function(event, data) { $scope.$on("$ionicView.enter", function(event, data) {
nextStep();
updateAllWallets(); updateAllWallets();
addressbookService.list(function(err, ab) { addressbookService.list(function(err, ab) {
@ -264,6 +263,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
]; ];
configService.whenAvailable(function() { configService.whenAvailable(function() {
nextStep(function() {
var config = configService.getSync(); var config = configService.getSync();
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
@ -280,6 +280,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.recentTransactionsEnabled = config.recentTransactions.enabled; $scope.recentTransactionsEnabled = config.recentTransactions.enabled;
if ($scope.bitpayCardEnabled) bitpayCardCache(); if ($scope.bitpayCardEnabled) bitpayCardCache();
$timeout(function() {
$ionicScrollDelegate.resize();
$scope.$apply();
}, 10);
});
}); });
}); });