Rename variables

This commit is contained in:
Gustavo Maximiliano Cortez 2015-12-07 12:52:42 -03:00
commit 8e69c0aa7e
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
5 changed files with 19 additions and 19 deletions

View file

@ -46,7 +46,7 @@
</div>
</div>
<div class="start-button columns">
<button ng-disabled="creatingProfile" ng-click="index.agreeDisclaimer()" class="button black expand round size-12 text-spacing" translate>
<button ng-disabled="creatingProfile" ng-click="index.acceptDisclaimer()" class="button black expand round size-12 text-spacing" translate>
I AGREE. GET STARTED
</button>
</div>

View file

@ -30,7 +30,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
else $scope.creatingProfile = false;
//compatible
profileService.checkDisclaimer(function(val) {
profileService.isDisclaimerAccepted(function(val) {
if (val) go.walletHome();
});
});

View file

@ -148,24 +148,24 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url);
};
self.agreeDisclaimer = function() {
self.acceptDisclaimer = function() {
var profile = profileService.profile;
if (profile) profile.agreeDisclaimer = true;
if (profile) profile.disclaimerAccepted = true;
self.disclaimerAccepted = true;
profileService.storeDisclaimer(function(err) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
go.walletHome();
});
};
self.checkDisclaimer = function() {
self.isDisclaimerAccepted = function() {
if (self.disclaimerAccepted == true) {
go.walletHome();
return;
}
profileService.checkDisclaimer(function(v) {
profileService.isDisclaimerAccepted(function(v) {
if (v) {
self.agreeDisclaimer();
self.acceptDisclaimer();
} else go.path('disclaimer');
});
};
@ -1240,7 +1240,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/Resume', function(event) {
$log.debug('### Resume event');
self.checkDisclaimer();
self.isDisclaimerAccepted();
self.debouncedUpdate();
});
@ -1363,7 +1363,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.setUxLanguage();
self.setFocusedWallet();
self.updateTxHistory();
self.checkDisclaimer();
self.isDisclaimerAccepted();
storageService.getCleanAndScanAddresses(function(err, walletId) {
if (walletId && profileService.walletClients[walletId]) {
$log.debug('Clear last address cache and Scan ', walletId);

View file

@ -15,7 +15,7 @@ Profile.create = function(opts) {
var x = new Profile();
x.createdOn = Date.now();
x.credentials = opts.credentials || [];
x.agreeDisclaimer = false;
x.disclaimerAccepted = false;
return x;
};
@ -24,7 +24,7 @@ Profile.fromObj = function(obj) {
x.createdOn = obj.createdOn;
x.credentials = obj.credentials;
x.agreeDisclaimer = obj.agreeDisclaimer;
x.disclaimerAccepted = obj.disclaimerAccepted;
if (x.credentials[0] && typeof x.credentials[0] != 'object')
throw ("credentials should be an object");

View file

@ -127,7 +127,7 @@ angular.module('copayApp.services')
if (err) return cb(err);
root._setFocus(focusedWalletId, function() {
$rootScope.$emit('Local/ProfileBound');
root.checkDisclaimer(function(val) {
root.isDisclaimerAccepted(function(val) {
if (!val) {
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
}
@ -521,23 +521,23 @@ angular.module('copayApp.services')
});
};
root.storeDisclaimer = function(cb) {
root.setDisclaimerAccepted = function(cb) {
storageService.getProfile(function(err, profile) {
profile.agreeDisclaimer = true;
profile.disclaimerAccepted = true;
storageService.storeProfile(profile, function(err) {
return cb(err);
});
});
};
root.checkDisclaimer = function(cb) {
root.isDisclaimerAccepted = function(cb) {
storageService.getProfile(function(err, profile) {
if (profile && profile.agreeDisclaimer)
if (profile && profile.disclaimerAccepted)
return cb(true);
else if (profile && !profile.agreeDisclaimer) {
else if (profile && !profile.disclaimerAccepted) {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (val) {
profile.agreeDisclaimer = true;
profile.disclaimerAccepted = true;
storageService.storeProfile(profile, function(err) {
if (err) $log.error(err);
return cb(true);