aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/routing/redirect.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/routing/redirect.service.ts')
-rw-r--r--client/src/app/core/routing/redirect.service.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts
index e239c6210..1120e6165 100644
--- a/client/src/app/core/routing/redirect.service.ts
+++ b/client/src/app/core/routing/redirect.service.ts
@@ -31,12 +31,15 @@ export class RedirectService {
31 private serverService: ServerService, 31 private serverService: ServerService,
32 private storage: SessionStorageService 32 private storage: SessionStorageService
33 ) { 33 ) {
34 // The config is first loaded from the cache so try to get the default route 34
35 }
36
37 init () {
35 const config = this.serverService.getHTMLConfig() 38 const config = this.serverService.getHTMLConfig()
36 if (config?.instance?.defaultClientRoute) { 39 if (config.instance.defaultClientRoute) {
37 this.defaultRoute = config.instance.defaultClientRoute 40 this.defaultRoute = config.instance.defaultClientRoute
38 } 41 }
39 if (config?.trending?.videos?.algorithms?.default) { 42 if (config.trending.videos.algorithms.default) {
40 this.defaultTrendingAlgorithm = config.trending.videos.algorithms.default 43 this.defaultTrendingAlgorithm = config.trending.videos.algorithms.default
41 } 44 }
42 45
@@ -47,7 +50,7 @@ export class RedirectService {
47 50
48 // Track previous url 51 // Track previous url
49 this.currentUrl = this.router.url 52 this.currentUrl = this.router.url
50 router.events.subscribe(event => { 53 this.router.events.subscribe(event => {
51 if (event instanceof NavigationEnd || event instanceof NavigationCancel) { 54 if (event instanceof NavigationEnd || event instanceof NavigationCancel) {
52 if ([ '/401', '/404' ].includes(event.url)) return 55 if ([ '/401', '/404' ].includes(event.url)) return
53 56