diff options
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/routing/redirect.service.ts | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts index abe044d73..844f184b4 100644 --- a/client/src/app/core/routing/redirect.service.ts +++ b/client/src/app/core/routing/redirect.service.ts | |||
@@ -19,30 +19,29 @@ export class RedirectService { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | this.serverService.configLoaded | 21 | this.serverService.configLoaded |
22 | .subscribe(() => { | 22 | .subscribe(() => { |
23 | const defaultRouteConfig = this.serverService.getConfig().instance.defaultClientRoute | 23 | const defaultRouteConfig = this.serverService.getConfig().instance.defaultClientRoute |
24 | 24 | ||
25 | if (defaultRouteConfig) { | 25 | if (defaultRouteConfig) { |
26 | RedirectService.DEFAULT_ROUTE = defaultRouteConfig | 26 | RedirectService.DEFAULT_ROUTE = defaultRouteConfig |
27 | } | 27 | } |
28 | }) | 28 | }) |
29 | } | 29 | } |
30 | 30 | ||
31 | redirectToHomepage () { | 31 | redirectToHomepage () { |
32 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) | 32 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) |
33 | 33 | ||
34 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true }) | 34 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true }) |
35 | .catch(() => { | 35 | .catch(() => { |
36 | console.error( | 36 | console.error( |
37 | 'Cannot navigate to %s, resetting default route to %s.', | 37 | 'Cannot navigate to %s, resetting default route to %s.', |
38 | RedirectService.DEFAULT_ROUTE, | 38 | RedirectService.DEFAULT_ROUTE, |
39 | RedirectService.INIT_DEFAULT_ROUTE | 39 | RedirectService.INIT_DEFAULT_ROUTE |
40 | ) | 40 | ) |
41 | 41 | ||
42 | RedirectService.DEFAULT_ROUTE = RedirectService.INIT_DEFAULT_ROUTE | 42 | RedirectService.DEFAULT_ROUTE = RedirectService.INIT_DEFAULT_ROUTE |
43 | return this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true }) | 43 | return this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { replaceUrl: true }) |
44 | }) | 44 | }) |
45 | 45 | ||
46 | } | 46 | } |
47 | |||
48 | } | 47 | } |