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