diff options
Diffstat (limited to 'client/src/app/app-routing.module.ts')
-rw-r--r-- | client/src/app/app-routing.module.ts | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index c0a2d29e4..23fd52e8b 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' | 2 | import { RouteReuseStrategy, RouterModule, Routes, UrlMatchResult, UrlSegment } from '@angular/router' |
3 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' | 3 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
4 | import { MenuGuards } from '@app/core/routing/menu-guard.service' | 4 | import { MenuGuards } from '@app/core/routing/menu-guard.service' |
5 | import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' | 5 | import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' |
6 | import { PreloadSelectedModulesList } from './core' | 6 | import { PreloadSelectedModulesList } from './core' |
7 | import { EmptyComponent } from './empty.component' | 7 | import { EmptyComponent } from './empty.component' |
8 | import { ActorsComponent } from './+actors/actors.component' | 8 | import { RootComponent } from './root.component' |
9 | 9 | ||
10 | const routes: Routes = [ | 10 | const routes: Routes = [ |
11 | { | 11 | { |
@@ -75,8 +75,20 @@ const routes: Routes = [ | |||
75 | redirectTo: 'video-channels' | 75 | redirectTo: 'video-channels' |
76 | }, | 76 | }, |
77 | { | 77 | { |
78 | path: ':actorName', | 78 | matcher: (url): UrlMatchResult => { |
79 | component: ActorsComponent | 79 | // Matches /@:actorName |
80 | if (url.length === 1 && url[0].path.match(/^@[\w]+$/gm)) { | ||
81 | return { | ||
82 | consumed: url, | ||
83 | posParams: { | ||
84 | actorName: new UrlSegment(url[0].path.substr(1), {}) | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | |||
89 | return null | ||
90 | }, | ||
91 | component: RootComponent | ||
80 | }, | 92 | }, |
81 | { | 93 | { |
82 | path: '', | 94 | path: '', |