diff options
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/routing/redirect.service.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts index 3982cf36f..4f4b346e2 100644 --- a/client/src/app/core/routing/redirect.service.ts +++ b/client/src/app/core/routing/redirect.service.ts | |||
@@ -11,6 +11,8 @@ export class RedirectService { | |||
11 | private previousUrl: string | 11 | private previousUrl: string |
12 | private currentUrl: string | 12 | private currentUrl: string |
13 | 13 | ||
14 | private redirectingToHomepage = false | ||
15 | |||
14 | constructor ( | 16 | constructor ( |
15 | private router: Router, | 17 | private router: Router, |
16 | private serverService: ServerService | 18 | private serverService: ServerService |
@@ -56,10 +58,17 @@ export class RedirectService { | |||
56 | } | 58 | } |
57 | 59 | ||
58 | redirectToHomepage (skipLocationChange = false) { | 60 | redirectToHomepage (skipLocationChange = false) { |
61 | if (this.redirectingToHomepage) return | ||
62 | |||
63 | this.redirectingToHomepage = true | ||
64 | |||
59 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) | 65 | console.log('Redirecting to %s...', RedirectService.DEFAULT_ROUTE) |
60 | 66 | ||
61 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange }) | 67 | this.router.navigate([ RedirectService.DEFAULT_ROUTE ], { skipLocationChange }) |
68 | .then(() => this.redirectingToHomepage = false) | ||
62 | .catch(() => { | 69 | .catch(() => { |
70 | this.redirectingToHomepage = false | ||
71 | |||
63 | console.error( | 72 | console.error( |
64 | 'Cannot navigate to %s, resetting default route to %s.', | 73 | 'Cannot navigate to %s, resetting default route to %s.', |
65 | RedirectService.DEFAULT_ROUTE, | 74 | RedirectService.DEFAULT_ROUTE, |