Revert routing issue
This commit is contained in:
parent
515b806fa3
commit
0894bdf684
1 changed files with 29 additions and 29 deletions
|
|
@ -1158,42 +1158,42 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
$ionicPlatform.on('menubutton', function() {
|
$ionicPlatform.on('menubutton', function() {
|
||||||
window.location = '#/preferences';
|
window.location = '#/preferences';
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
$log.info('Init profile...');
|
$log.info('Init profile...');
|
||||||
// Try to open local profile
|
// Try to open local profile
|
||||||
profileService.loadAndBindProfile(function(err) {
|
profileService.loadAndBindProfile(function(err) {
|
||||||
$ionicHistory.nextViewOptions({
|
$ionicHistory.nextViewOptions({
|
||||||
disableAnimate: true
|
disableAnimate: true
|
||||||
});
|
});
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.message && err.message.match('NOPROFILE')) {
|
if (err.message && err.message.match('NOPROFILE')) {
|
||||||
$log.debug('No profile... redirecting');
|
$log.debug('No profile... redirecting');
|
||||||
$state.go('onboarding.welcome');
|
|
||||||
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
|
|
||||||
if (lodash.isEmpty(profileService.getWallets())) {
|
|
||||||
$log.debug('No wallets and no disclaimer... redirecting');
|
|
||||||
$state.go('onboarding.welcome');
|
$state.go('onboarding.welcome');
|
||||||
|
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
|
||||||
|
if (lodash.isEmpty(profileService.getWallets())) {
|
||||||
|
$log.debug('No wallets and no disclaimer... redirecting');
|
||||||
|
$state.go('onboarding.welcome');
|
||||||
|
} else {
|
||||||
|
$log.debug('Display disclaimer... redirecting');
|
||||||
|
$state.go('onboarding.disclaimer', {
|
||||||
|
resume: true
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$log.debug('Display disclaimer... redirecting');
|
throw new Error(err); // TODO
|
||||||
$state.go('onboarding.disclaimer', {
|
|
||||||
resume: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(err); // TODO
|
profileService.storeProfileIfDirty();
|
||||||
|
$log.debug('Profile loaded ... Starting UX.');
|
||||||
|
scannerService.gentleInitialize();
|
||||||
|
$state.go('tabs.home');
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
profileService.storeProfileIfDirty();
|
|
||||||
$log.debug('Profile loaded ... Starting UX.');
|
|
||||||
scannerService.gentleInitialize();
|
|
||||||
$state.go('tabs.home');
|
|
||||||
}
|
|
||||||
|
|
||||||
// After everything have been loaded, initialize handler URL
|
// After everything have been loaded, initialize handler URL
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
openURLService.init();
|
openURLService.init();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (platformInfo.isNW) {
|
if (platformInfo.isNW) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue