This commit is contained in:
Gabriel Bazán 2015-11-30 13:32:54 -03:00
commit 9aeb1ea4fd
3 changed files with 22 additions and 19 deletions

View file

@ -1,5 +1,4 @@
<div class="splash content text-center"
ng-init="init()"
ng-controller="disclaimerController">
<div>
<div class="row">

View file

@ -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;

View file

@ -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();