add controllers files to displaimer and splash

This commit is contained in:
Matias Alejo Garcia 2015-08-27 11:24:39 -03:00
commit 39e6a81b62
7 changed files with 74 additions and 62 deletions

View file

@ -0,0 +1,32 @@
'use strict';
angular.module('copayApp.controllers').controller('splashController',
function($scope, $timeout, $log, profileService, storageService, go) {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (!val) go.path('disclaimer');
if (profileService.profile) {
go.walletHome();
}
});
$scope.create = function(noWallet) {
$scope.creatingProfile = true;
$timeout(function() {
profileService.create({
noWallet: noWallet
}, function(err) {
if (err) {
$scope.creatingProfile = false;
$log.warn(err);
$scope.error = err;
$scope.$apply();
$timeout(function() {
$scope.create(noWallet);
}, 3000);
}
});
}, 100);
};
});