Rename variables
This commit is contained in:
parent
bdfa89115d
commit
8e69c0aa7e
5 changed files with 19 additions and 19 deletions
|
|
@ -46,7 +46,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="start-button columns">
|
<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
|
I AGREE. GET STARTED
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
else $scope.creatingProfile = false;
|
else $scope.creatingProfile = false;
|
||||||
|
|
||||||
//compatible
|
//compatible
|
||||||
profileService.checkDisclaimer(function(val) {
|
profileService.isDisclaimerAccepted(function(val) {
|
||||||
if (val) go.walletHome();
|
if (val) go.walletHome();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.agreeDisclaimer = function() {
|
self.acceptDisclaimer = function() {
|
||||||
var profile = profileService.profile;
|
var profile = profileService.profile;
|
||||||
if (profile) profile.agreeDisclaimer = true;
|
if (profile) profile.disclaimerAccepted = true;
|
||||||
self.disclaimerAccepted = true;
|
self.disclaimerAccepted = true;
|
||||||
profileService.storeDisclaimer(function(err) {
|
profileService.setDisclaimerAccepted(function(err) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
go.walletHome();
|
go.walletHome();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.checkDisclaimer = function() {
|
self.isDisclaimerAccepted = function() {
|
||||||
if (self.disclaimerAccepted == true) {
|
if (self.disclaimerAccepted == true) {
|
||||||
go.walletHome();
|
go.walletHome();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
profileService.checkDisclaimer(function(v) {
|
profileService.isDisclaimerAccepted(function(v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
self.agreeDisclaimer();
|
self.acceptDisclaimer();
|
||||||
} else go.path('disclaimer');
|
} else go.path('disclaimer');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -1240,7 +1240,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
|
|
||||||
$rootScope.$on('Local/Resume', function(event) {
|
$rootScope.$on('Local/Resume', function(event) {
|
||||||
$log.debug('### Resume event');
|
$log.debug('### Resume event');
|
||||||
self.checkDisclaimer();
|
self.isDisclaimerAccepted();
|
||||||
self.debouncedUpdate();
|
self.debouncedUpdate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1363,7 +1363,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
self.setUxLanguage();
|
self.setUxLanguage();
|
||||||
self.setFocusedWallet();
|
self.setFocusedWallet();
|
||||||
self.updateTxHistory();
|
self.updateTxHistory();
|
||||||
self.checkDisclaimer();
|
self.isDisclaimerAccepted();
|
||||||
storageService.getCleanAndScanAddresses(function(err, walletId) {
|
storageService.getCleanAndScanAddresses(function(err, walletId) {
|
||||||
if (walletId && profileService.walletClients[walletId]) {
|
if (walletId && profileService.walletClients[walletId]) {
|
||||||
$log.debug('Clear last address cache and Scan ', walletId);
|
$log.debug('Clear last address cache and Scan ', walletId);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ Profile.create = function(opts) {
|
||||||
var x = new Profile();
|
var x = new Profile();
|
||||||
x.createdOn = Date.now();
|
x.createdOn = Date.now();
|
||||||
x.credentials = opts.credentials || [];
|
x.credentials = opts.credentials || [];
|
||||||
x.agreeDisclaimer = false;
|
x.disclaimerAccepted = false;
|
||||||
return x;
|
return x;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ Profile.fromObj = function(obj) {
|
||||||
|
|
||||||
x.createdOn = obj.createdOn;
|
x.createdOn = obj.createdOn;
|
||||||
x.credentials = obj.credentials;
|
x.credentials = obj.credentials;
|
||||||
x.agreeDisclaimer = obj.agreeDisclaimer;
|
x.disclaimerAccepted = obj.disclaimerAccepted;
|
||||||
|
|
||||||
if (x.credentials[0] && typeof x.credentials[0] != 'object')
|
if (x.credentials[0] && typeof x.credentials[0] != 'object')
|
||||||
throw ("credentials should be an object");
|
throw ("credentials should be an object");
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ angular.module('copayApp.services')
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
root._setFocus(focusedWalletId, function() {
|
root._setFocus(focusedWalletId, function() {
|
||||||
$rootScope.$emit('Local/ProfileBound');
|
$rootScope.$emit('Local/ProfileBound');
|
||||||
root.checkDisclaimer(function(val) {
|
root.isDisclaimerAccepted(function(val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
|
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) {
|
storageService.getProfile(function(err, profile) {
|
||||||
profile.agreeDisclaimer = true;
|
profile.disclaimerAccepted = true;
|
||||||
storageService.storeProfile(profile, function(err) {
|
storageService.storeProfile(profile, function(err) {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
root.checkDisclaimer = function(cb) {
|
root.isDisclaimerAccepted = function(cb) {
|
||||||
storageService.getProfile(function(err, profile) {
|
storageService.getProfile(function(err, profile) {
|
||||||
if (profile && profile.agreeDisclaimer)
|
if (profile && profile.disclaimerAccepted)
|
||||||
return cb(true);
|
return cb(true);
|
||||||
else if (profile && !profile.agreeDisclaimer) {
|
else if (profile && !profile.disclaimerAccepted) {
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
storageService.getCopayDisclaimerFlag(function(err, val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
profile.agreeDisclaimer = true;
|
profile.disclaimerAccepted = true;
|
||||||
storageService.storeProfile(profile, function(err) {
|
storageService.storeProfile(profile, function(err) {
|
||||||
if (err) $log.error(err);
|
if (err) $log.error(err);
|
||||||
return cb(true);
|
return cb(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue