aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/routing/redirect.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-31 11:35:01 +0200
committerChocobozzz <me@florianbigard.com>2018-05-31 14:24:13 +0200
commita51bad1accfade25916db0dadaeb879a182cf19b (patch)
tree128330863a1125be437cf8ba9bc0c6c529068520 /client/src/app/core/routing/redirect.service.ts
parent351d5225d6a4fe6863f760f02454eac88f730607 (diff)
downloadPeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.tar.gz
PeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.tar.zst
PeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.zip
Add 404 page
Diffstat (limited to 'client/src/app/core/routing/redirect.service.ts')
-rw-r--r--client/src/app/core/routing/redirect.service.ts31
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}