adding agreeDisclaimer flag for compatibility
This commit is contained in:
parent
9aeb1ea4fd
commit
b9557d47d2
7 changed files with 74 additions and 57 deletions
|
|
@ -12,8 +12,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="scrollArea" ng-include="'views/includes/terms.html'">
|
||||
</div>
|
||||
<p class="enable_text_select m0">
|
||||
<div class="scrollArea" ng-include="'views/includes/terms.html'"></div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<p class="enable_text_select m0">
|
||||
<div class="size-16 text-gray" translate>Terms of Use</div>
|
||||
<ul>
|
||||
<li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li>
|
||||
<li translate>The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.</li>
|
||||
|
|
@ -14,4 +12,3 @@
|
|||
<li translate>In no event shall the authors of the software, employees and affiliates of Bitpay, copyright holders, or BitPay, Inc. be held liable for any claim, damages or other liability, whether in an action of contract, tort, or otherwise, arising from, out of or in connection with the software.</li>
|
||||
<li translate>We reserve the right to modify this disclaimer from time to time.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
<div class="splash content text-center">
|
||||
<div
|
||||
class="topbar-container"
|
||||
ng-include="'views/includes/topbar.html'"
|
||||
ng-init="titleSection='Terms of use'; goBackToState = 'about'; noColor = true">
|
||||
</div>
|
||||
|
||||
<div class="scrollArea" style="height: 80vh;">
|
||||
<p class="enable_text_select m0">
|
||||
<div ng-include="'views/includes/terms.html'"></div>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p ng-show="lang != 'en'">
|
||||
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="extra-margin-bottom"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -473,13 +473,16 @@ angular
|
|||
|
||||
storageService.getProfile(function(err, profile) {
|
||||
|
||||
//for compatibility
|
||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
||||
|
||||
$log.debug('### State: ', $stateParams.status);
|
||||
switch ($stateParams.status) {
|
||||
case 'resume':
|
||||
$rootScope.$emit('Local/Resume');
|
||||
break;
|
||||
case 'backbutton':
|
||||
var shouldExit = $stateParams.isHome == 'true' || !profile.agreeDisclaimer;
|
||||
var shouldExit = $stateParams.isHome == 'true' || !profile.agreeDisclaimer || !val;
|
||||
if (isCordova && shouldExit && !$rootScope.modalOpened) {
|
||||
return navigator.app.exitApp();
|
||||
} else {
|
||||
|
|
@ -488,12 +491,13 @@ angular
|
|||
break;
|
||||
};
|
||||
|
||||
if (profile.agreeDisclaimer) {
|
||||
if (profile.agreeDisclaimer || val) {
|
||||
go.walletHome(true);
|
||||
} else {
|
||||
$state.transitionTo('disclaimer');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue