diff --git a/public/views/disclaimer.html b/public/views/disclaimer.html
index 81e0af61d..1014b3b68 100644
--- a/public/views/disclaimer.html
+++ b/public/views/disclaimer.html
@@ -12,8 +12,9 @@
+
-
-
-
-
diff --git a/src/js/controllers/disclaimer.js b/src/js/controllers/disclaimer.js
index b428aa19a..c26ddcb30 100644
--- a/src/js/controllers/disclaimer.js
+++ b/src/js/controllers/disclaimer.js
@@ -38,7 +38,10 @@ angular.module('copayApp.controllers').controller('disclaimerController',
storageService.getProfile(function(err, profile) {
if (!profile) create();
else $scope.creatingProfile = false;
+
+ //compatible
+ storageService.getCopayDisclaimerFlag(function(err, val) {
+ if (val) go.walletHome();
+ });
});
-
-
});
diff --git a/src/js/routes.js b/src/js/routes.js
index 6433dab2c..cd9b73558 100644
--- a/src/js/routes.js
+++ b/src/js/routes.js
@@ -473,26 +473,30 @@ angular
storageService.getProfile(function(err, profile) {
- $log.debug('### State: ', $stateParams.status);
- switch ($stateParams.status) {
- case 'resume':
- $rootScope.$emit('Local/Resume');
- break;
- case 'backbutton':
- var shouldExit = $stateParams.isHome == 'true' || !profile.agreeDisclaimer;
- if (isCordova && shouldExit && !$rootScope.modalOpened) {
- return navigator.app.exitApp();
- } else {
- $rootScope.$emit('closeModal');
- }
- break;
- };
+ //for compatibility
+ storageService.getCopayDisclaimerFlag(function(err, val) {
- if (profile.agreeDisclaimer) {
- go.walletHome(true);
- } else {
- $state.transitionTo('disclaimer');
- }
+ $log.debug('### State: ', $stateParams.status);
+ switch ($stateParams.status) {
+ case 'resume':
+ $rootScope.$emit('Local/Resume');
+ break;
+ case 'backbutton':
+ var shouldExit = $stateParams.isHome == 'true' || !profile.agreeDisclaimer || !val;
+ if (isCordova && shouldExit && !$rootScope.modalOpened) {
+ return navigator.app.exitApp();
+ } else {
+ $rootScope.$emit('closeModal');
+ }
+ break;
+ };
+
+ if (profile.agreeDisclaimer || val) {
+ go.walletHome(true);
+ } else {
+ $state.transitionTo('disclaimer');
+ }
+ });
});
}
}
diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js
index 70efa5d15..4c1f5a117 100644
--- a/src/js/services/profileService.js
+++ b/src/js/services/profileService.js
@@ -134,7 +134,6 @@ angular.module('copayApp.services')
};
root.loadAndBindProfile = function(cb) {
-
storageService.getProfile(function(err, profile) {
if (err) {
$rootScope.$emit('Local/DeviceError', err);
@@ -151,10 +150,13 @@ angular.module('copayApp.services')
return root.bindProfile(profile, cb);
})
} else {
- if (!profile.agreeDisclaimer)
- return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
- $log.debug('Profile read');
- return root.bindProfile(profile, cb);
+ storageService.getCopayDisclaimerFlag(function(err, val) {
+ if (!profile.agreeDisclaimer) {
+ if (!val) return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
+ }
+ $log.debug('Profile read');
+ return root.bindProfile(profile, cb);
+ });
}
});
};
diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js
index 76bbf97c5..22ce21595 100644
--- a/src/js/services/storageService.js
+++ b/src/js/services/storageService.js
@@ -198,6 +198,11 @@ angular.module('copayApp.services')
storage.remove('config', cb);
};
+ //for compatibility
+ root.getCopayDisclaimerFlag = function(cb) {
+ storage.get('agreeDisclaimer', cb);
+ };
+
root.setRemotePrefsStoredFlag = function(cb) {
storage.set('remotePrefStored', true, cb);
};