refactor
This commit is contained in:
parent
3f7485ca8d
commit
9aeb1ea4fd
3 changed files with 22 additions and 19 deletions
|
|
@ -1,5 +1,4 @@
|
|||
<div class="splash content text-center"
|
||||
ng-init="init()"
|
||||
ng-controller="disclaimerController">
|
||||
<div>
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
|||
$scope.lang = uxLanguage.currentLanguage;
|
||||
|
||||
$scope.goHome = function() {
|
||||
storageService.getProfile(function(err, profile) {
|
||||
profile.agreeDisclaimer = true;
|
||||
storageService.storeProfile(profile, function() {
|
||||
go.walletHome();
|
||||
});
|
||||
$scope.error = "";
|
||||
profileService.storeDisclaimer(function(err) {
|
||||
if (err) {
|
||||
$scope.error = err;
|
||||
$log.warn(err);
|
||||
$scope.$apply();
|
||||
} else go.walletHome();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -20,19 +22,12 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
|||
|
||||
if (err) {
|
||||
$log.warn(err);
|
||||
if (err == 'EEXISTS') {
|
||||
|
||||
if (profileService.profile.agreeDisclaimer) return go.walletHome();
|
||||
$scope.creatingProfile = false;
|
||||
|
||||
} else {
|
||||
$scope.error = err;
|
||||
$scope.$apply();
|
||||
$timeout(function() {
|
||||
$log.warn('Retrying to create profile......');
|
||||
create();
|
||||
}, 3000);
|
||||
}
|
||||
$scope.error = err;
|
||||
$scope.$apply();
|
||||
$timeout(function() {
|
||||
$log.warn('Retrying to create profile......');
|
||||
create();
|
||||
}, 3000);
|
||||
} else {
|
||||
$scope.error = "";
|
||||
$scope.creatingProfile = false;
|
||||
|
|
|
|||
|
|
@ -516,6 +516,15 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.storeDisclaimer = function(cb) {
|
||||
storageService.getProfile(function(err, profile) {
|
||||
profile.agreeDisclaimer = true;
|
||||
storageService.storeProfile(profile, function() {
|
||||
return cb(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
root.importLegacyWallet = function(username, password, blob, cb) {
|
||||
var walletClient = bwcService.getClient();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue