fix next steps

This commit is contained in:
Gabriel Bazán 2016-10-27 11:45:38 -03:00
commit 038a4413d0

View file

@ -181,13 +181,13 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}); });
}; };
var nextStep = function() { var nextStep = function(cb) {
lodash.each(['AmazonGiftCards', 'BitpayCard', 'BuyAndSell'], function(service) { var i = 1;
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);
}); });
}); });
}; };
@ -227,7 +227,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) {
@ -248,6 +247,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;
@ -264,6 +264,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);
});
}); });
}); });