Ref and clean code

This commit is contained in:
Gustavo Maximiliano Cortez 2016-10-12 09:38:41 -03:00
commit 95c0371f9b
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
4 changed files with 24 additions and 33 deletions

View file

@ -1,5 +1,5 @@
'use strict';
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $log, $state, $timeout, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService) {
angular.module('copayApp.controllers').controller('bitpayCardIntroController', function($scope, $log, $state, $ionicHistory, storageService, externalLinkService, bitpayCardService, gettextCatalog, popupService) {
var checkOtp = function(obj, cb) {
if (obj.otp) {
@ -41,12 +41,11 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
$ionicHistory.nextViewOptions({
disableAnimate: true
});
$state.go('tabs.home');
if (data.cards[0]) {
$timeout(function() {
$state.go('tabs.home').then(function() {
if (data.cards[0]) {
$state.transitionTo('tabs.bitpayCard', {id: data.cards[0].id});
}, 100);
}
}
});
});
}
});