Wallet/src/js/controllers/splash.js

35 lines
898 B
JavaScript
Raw Normal View History

'use strict';
angular.module('copayApp.controllers').controller('splashController',
2015-09-16 13:52:28 -03:00
function($scope, $timeout, $log, profileService, storageService, go) {
$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);
};
2015-09-16 13:52:28 -03:00
$scope.init = function() {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (!val) go.path('disclaimer');
if (profileService.profile) {
go.walletHome();
}
});
};
});