fix blank page

This commit is contained in:
Gabriel Bazán 2015-11-24 17:16:52 -03:00
commit fd32a1ec91
3 changed files with 44 additions and 31 deletions

View file

@ -1,10 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('disclaimerController',
function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) {
function($scope, $timeout, $log, profileService, isCordova, storageService, applicationService, gettextCatalog, uxLanguage, go) {
self = this;
$scope.lang = uxLanguage.currentLanguage;
$scope.goHome = function() {
storageService.setCopayDisclaimerFlag(function(err) {
go.walletHome();
@ -16,14 +15,13 @@ angular.module('copayApp.controllers').controller('disclaimerController',
profileService.create({}, function(err) {
if (err) {
$log.warn(err);
if (err == 'EEXISTS') {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (val) return go.walletHome();
$scope.creatingProfile = false;
});
} else {
$log.warn(err);
$scope.error = err;
$scope.$apply();
$timeout(function() {
@ -38,6 +36,8 @@ angular.module('copayApp.controllers').controller('disclaimerController',
});
};
create();
if (!profileService.profile)
create();
else
applicationService.restart();
});