Removes createProfile page. Fixes transition from splash to walletHome

This commit is contained in:
Gustavo Maximiliano Cortez 2015-05-12 12:19:57 -03:00
commit cb7c0bd19d
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 46 additions and 71 deletions

View file

@ -1,26 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('createProfileController', function($rootScope, $scope, $log, $timeout, profileService, go) {
var self = this;
if (profileService.profile)
go.walletHome();
self.creatingProfile = true;
$timeout(function() {
profileService.create(function(err) {
if (err) {
self.creatingProfile = false;
$log.warn(err);
self.error = err;
$scope.$apply();
$timeout(function() {
go.reload();
}, 3000);
} else {
go.walletHome();
}
});
}, 100);
});

View file

@ -68,7 +68,33 @@ angular
needProfile: false,
views: {
'main': {
templateUrl: 'views/splash/1.html'
templateUrl: 'views/splash/1.html',
controller: function($scope, $timeout, $log, profileService, go) {
if (profileService.profile) {
$scope.hasProfile = true;
go.walletHome();
}
$scope.create = function() {
$scope.creatingProfile = true;
profileService.create(function(err) {
if (err) {
$scope.creatingProfile = false;
$log.warn(err);
$scope.error = err;
$scope.$apply();
$timeout(function() {
$scope.create();
}, 3000);
} else {
$timeout(function(){
go.walletHome();
}, 100);
}
});
};
}
}
}
})
@ -82,20 +108,6 @@ angular
},
}
})
.state('createProfile', {
url: '/createProfile',
needProfile: false,
views: {
'main': {
templateUrl: 'views/createProfile.html',
controller: function($scope) {
// TODO
// $scope.mainDark = true;
$scope.noColor = true;
}
}
}
})
.state('unsupported', {
url: '/unsupported',
needProfile: false,