adding agreeDisclaimer flag for compatibility

This commit is contained in:
Gabriel Bazán 2015-11-30 16:34:24 -03:00
commit b9557d47d2
7 changed files with 74 additions and 57 deletions

View file

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

View file

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