Refactor auth guard (#226)

pull/228/head
Thomas 3 years ago committed by GitHub
parent a3a9957196
commit d53e5c4da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,6 +63,7 @@ export class AuthGuard implements CanActivate {
) {
this.router.navigate(['/zen']);
resolve(false);
return;
} else if (state.url.startsWith('/start')) {
if (user.settings.viewMode === ViewMode.ZEN) {
this.router.navigate(['/zen']);
@ -71,12 +72,14 @@ export class AuthGuard implements CanActivate {
}
resolve(false);
return;
} else if (
state.url.startsWith('/zen') &&
user.settings.viewMode === ViewMode.DEFAULT
) {
this.router.navigate(['/home']);
resolve(false);
return;
}
resolve(true);

Loading…
Cancel
Save