Browse Source

Fix internal navigation with query parameter

pull/114/head
Thomas 4 years ago
parent
commit
9259a9b217
  1. 6
      apps/client/src/app/core/auth.guard.ts

6
apps/client/src/app/core/auth.guard.ts

@ -45,12 +45,12 @@ export class AuthGuard implements CanActivate {
) )
.subscribe((user) => { .subscribe((user) => {
if ( if (
state.url === '/home' && state.url.startsWith('/home') &&
user.settings.viewMode === ViewMode.ZEN user.settings.viewMode === ViewMode.ZEN
) { ) {
this.router.navigate(['/zen']); this.router.navigate(['/zen']);
resolve(false); resolve(false);
} else if (state.url === '/start') { } else if (state.url.startsWith('/start')) {
if (user.settings.viewMode === ViewMode.ZEN) { if (user.settings.viewMode === ViewMode.ZEN) {
this.router.navigate(['/zen']); this.router.navigate(['/zen']);
} else { } else {
@ -59,7 +59,7 @@ export class AuthGuard implements CanActivate {
resolve(false); resolve(false);
} else if ( } else if (
state.url === '/zen' && state.url.startsWith('/zen') &&
user.settings.viewMode === ViewMode.DEFAULT user.settings.viewMode === ViewMode.DEFAULT
) { ) {
this.router.navigate(['/home']); this.router.navigate(['/home']);

Loading…
Cancel
Save