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

@ -12,8 +12,9 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="scrollArea" ng-include="'views/includes/terms.html'"> <p class="enable_text_select m0">
</div> <div class="scrollArea" ng-include="'views/includes/terms.html'"></div>
</p>
</div> </div>
</div> </div>

View file

@ -1,17 +1,14 @@
<p class="enable_text_select m0"> <ul>
<div class="size-16 text-gray" translate>Terms of Use</div> <li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li>
<ul> <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>
<li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li> <li translate>While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.</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> <li translate>You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.</li>
<li translate>While the software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, we cannot guarantee that there will be no bugs in the software.</li> <li translate>You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.</li>
<li translate>You acknowledge that your use of this software is at your own discretion and in compliance with all applicable laws.</li> <li translate><b>IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.</b></li>
<li translate>You are responsible for safekeeping your passwords, private key pairs, PINs and any other codes you use to access the software.</li> <li translate>All transaction requests are irreversible.</li>
<li translate><b>IF YOU LOSE ACCESS TO YOUR COPAY WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY BITCOIN YOU HAVE ASSOCIATED WITH THAT COPAY WALLET WILL BECOME INACCESSIBLE.</b></li> <li translate>The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.</li>
<li translate>All transaction requests are irreversible.</li> <li translate>To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.</li>
<li translate>The authors of the software, employees and affiliates of Bitpay, copyright holders, and BitPay, Inc. cannot retrieve your private keys or passwords if you lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Bitcoin network.</li> <li translate>You assume any and all risks associated with the use of the software.</li>
<li translate>To the fullest extent permitted by law, this software is provided “as is” and no representations or warranties can be made of any kind, express or implied, including but not limited to the warranties of merchantability, fitness or a particular purpose and noninfringement.</li> <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>You assume any and all risks associated with the use of the software.</li> <li translate>We reserve the right to modify this disclaimer from time to time.</li>
<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> </ul>
<li translate>We reserve the right to modify this disclaimer from time to time.</li>
</ul>
</p>

View file

@ -1,13 +1,18 @@
<div <div class="splash content text-center">
class="topbar-container" <div
ng-include="'views/includes/topbar.html'" class="topbar-container"
ng-init="titleSection='Terms of use'; goBackToState = 'about'; noColor = true"> 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> </div>
<div ng-include="'views/includes/terms.html'"></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>

View file

@ -38,7 +38,10 @@ angular.module('copayApp.controllers').controller('disclaimerController',
storageService.getProfile(function(err, profile) { storageService.getProfile(function(err, profile) {
if (!profile) create(); if (!profile) create();
else $scope.creatingProfile = false; else $scope.creatingProfile = false;
//compatible
storageService.getCopayDisclaimerFlag(function(err, val) {
if (val) go.walletHome();
});
}); });
}); });

View file

@ -473,26 +473,30 @@ angular
storageService.getProfile(function(err, profile) { storageService.getProfile(function(err, profile) {
$log.debug('### State: ', $stateParams.status); //for compatibility
switch ($stateParams.status) { storageService.getCopayDisclaimerFlag(function(err, val) {
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;
};
if (profile.agreeDisclaimer) { $log.debug('### State: ', $stateParams.status);
go.walletHome(true); switch ($stateParams.status) {
} else { case 'resume':
$state.transitionTo('disclaimer'); $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');
}
});
}); });
} }
} }

View file

@ -134,7 +134,6 @@ angular.module('copayApp.services')
}; };
root.loadAndBindProfile = function(cb) { root.loadAndBindProfile = function(cb) {
storageService.getProfile(function(err, profile) { storageService.getProfile(function(err, profile) {
if (err) { if (err) {
$rootScope.$emit('Local/DeviceError', err); $rootScope.$emit('Local/DeviceError', err);
@ -151,10 +150,13 @@ angular.module('copayApp.services')
return root.bindProfile(profile, cb); return root.bindProfile(profile, cb);
}) })
} else { } else {
if (!profile.agreeDisclaimer) storageService.getCopayDisclaimerFlag(function(err, val) {
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer')); if (!profile.agreeDisclaimer) {
$log.debug('Profile read'); if (!val) return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
return root.bindProfile(profile, cb); }
$log.debug('Profile read');
return root.bindProfile(profile, cb);
});
} }
}); });
}; };

View file

@ -198,6 +198,11 @@ angular.module('copayApp.services')
storage.remove('config', cb); storage.remove('config', cb);
}; };
//for compatibility
root.getCopayDisclaimerFlag = function(cb) {
storage.get('agreeDisclaimer', cb);
};
root.setRemotePrefsStoredFlag = function(cb) { root.setRemotePrefsStoredFlag = function(cb) {
storage.set('remotePrefStored', true, cb); storage.set('remotePrefStored', true, cb);
}; };