+ redirectToHomepage (skipLocationChange = false) {
+ if (this.redirectingToHomepage) return
+
+ this.redirectingToHomepage = true
+
+ console.log('Redirecting to %s...', this.defaultRoute)
+
+ this.router.navigateByUrl(this.defaultRoute, { skipLocationChange })
+ .then(() => this.redirectingToHomepage = false)
+ .catch(() => {
+ this.redirectingToHomepage = false
+
+ console.error(
+ 'Cannot navigate to %s, resetting default route to %s.',
+ this.defaultRoute,
+ RedirectService.INIT_DEFAULT_ROUTE
+ )
+
+ this.defaultRoute = RedirectService.INIT_DEFAULT_ROUTE
+ return this.router.navigateByUrl(this.defaultRoute, { skipLocationChange })
+ })
+
+ }