Merge pull request #370 from gabrielbazan7/fix/resume

if no wallet resume welcome - if no disclaimer accepted resume disclaimer
This commit is contained in:
Matias Alejo Garcia 2016-10-11 13:18:29 -03:00 committed by GitHub
commit c38d0ed221
6 changed files with 28609 additions and 40 deletions

11968
public/css/copay.css Normal file

File diff suppressed because it is too large Load diff

16611
public/js/copay.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -6,6 +6,7 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
$scope.terms = {}; $scope.terms = {};
$scope.accept1 = $scope.accept2 = $scope.accept3 = false; $scope.accept1 = $scope.accept2 = $scope.accept3 = false;
$scope.backedUp = $stateParams.backedUp; $scope.backedUp = $stateParams.backedUp;
$scope.resume = $stateParams.resume;
$timeout(function() { $timeout(function() {
$scope.$apply(); $scope.$apply();
}, 1); }, 1);
@ -35,8 +36,10 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
}); });
}; };
$scope.goBack = function(){ $scope.goBack = function() {
$state.go('onboarding.backupRequest', {walletId: $stateParams.walletId}); $state.go('onboarding.backupRequest', {
walletId: $stateParams.walletId
});
} }

View file

@ -689,7 +689,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
.state('onboarding.disclaimer', { .state('onboarding.disclaimer', {
url: '/disclaimer/:walletId/:backedUp', url: '/disclaimer/:walletId/:backedUp/:resume',
views: { views: {
'onboarding': { 'onboarding': {
templateUrl: 'views/onboarding/disclaimer.html' templateUrl: 'views/onboarding/disclaimer.html'
@ -840,13 +840,13 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}) })
/* /*
* *
* BitPay Card * BitPay Card
* *
*/ */
.state('tabs.bitpayCard', { .state('tabs.bitpayCard', {
url: '/bitpay-card', url: '/bitpay-card',
views: { views: {
'tab-home@tabs': { 'tab-home@tabs': {
@ -973,21 +973,21 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$log.debug('No profile... redirecting'); $log.debug('No profile... redirecting');
$state.go('onboarding.welcome'); $state.go('onboarding.welcome');
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) { } else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
$log.debug('Display disclaimer... redirecting'); if (lodash.isEmpty(profileService.getWallets())) {
storageService.getLastState(function(err, state) { $log.debug('No wallets and no disclaimer... redirecting');
if (err && !state) { $state.go('onboarding.welcome');
$log.error(err); }
$state.go('onboarding.disclaimer'); else {
} $log.debug('Display disclaimer... redirecting');
else { $state.go('onboarding.disclaimer', {
var state = JSON.parse(state); resume: true
$state.go(state.name, state.toParams); });
} }
})
} else { } else {
throw new Error(err); // TODO throw new Error(err); // TODO
} }
} else { }
else {
profileService.storeProfileIfDirty(); profileService.storeProfileIfDirty();
$log.debug('Profile loaded ... Starting UX.'); $log.debug('Profile loaded ... Starting UX.');
scannerService.gentleInitialize(); scannerService.gentleInitialize();
@ -1014,11 +1014,5 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$log.debug('Route change from:', fromState.name || '-', ' to:', toState.name); $log.debug('Route change from:', fromState.name || '-', ' to:', toState.name);
$log.debug(' toParams:' + JSON.stringify(toParams || {})); $log.debug(' toParams:' + JSON.stringify(toParams || {}));
$log.debug(' fromParams:' + JSON.stringify(fromParams || {})); $log.debug(' fromParams:' + JSON.stringify(fromParams || {}));
if (!toState.name.match(/onboarding/)) return;
var state = {};
state.name = toState.name;
state.toParams = toParams;
if (state.name != 'starting') storageService.setLastState(JSON.stringify(state), function() {});
}); });
}); });

View file

@ -199,9 +199,9 @@ angular.module('copayApp.services')
storage.get('homeTip', cb); storage.get('homeTip', cb);
}; };
root.setHomeTipAccepted = function(val, cb) { root.setHomeTipAccepted = function(val, cb) {
storage.set('homeTip', val, cb); storage.set('homeTip', val, cb);
}; };
root.setHideBalanceFlag = function(walletId, val, cb) { root.setHideBalanceFlag = function(walletId, val, cb) {
storage.set('hideBalance-' + walletId, val, cb); storage.set('hideBalance-' + walletId, val, cb);
@ -284,14 +284,6 @@ angular.module('copayApp.services')
storage.remove('nextStep-' + service, cb); storage.remove('nextStep-' + service, cb);
}; };
root.setLastState = function(state, toParams, cb) {
storage.set('lastState', state, toParams, cb);
};
root.getLastState = function(cb) {
storage.get('lastState', cb);
};
root.checkQuota = function() { root.checkQuota = function() {
var block = ''; var block = '';
// 50MB // 50MB

View file

@ -9,8 +9,9 @@
</ion-nav-bar> </ion-nav-bar>
<ion-content scroll="false" ng-class="{'has-header': backedUp == 'false'}"> <ion-content scroll="false" ng-class="{'has-header': backedUp == 'false'}">
<div id="onboarding-disclaimer-container"> <div id="onboarding-disclaimer-container">
<div class="onboarding-topic" id="disclaimer-topic">Almost done! Let's review.</div> <div ng-show="resume" class="onboarding-topic" id="disclaimer-topic" translate>Quick review!</div>
<div class="onboarding-description" id="disclaimer-description">Bitcoin is different &ndash; it cannot be safely held with a bank or web service.</div> <div ng-show="!resume" class="onboarding-topic" id="disclaimer-topic" translate>Almost done! Let's review.</div>
<div class="onboarding-description" id="disclaimer-description" translate>Bitcoin is different &ndash; it cannot be safely held with a bank or web service.</div>
<ion-list> <ion-list>
<ion-checkbox ng-model="accept1"> <ion-checkbox ng-model="accept1">
<span translate>I understand that my funds are held securely on this device, not by a company.</span> <span translate>I understand that my funds are held securely on this device, not by a company.</span>