aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app-routing.module.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/app-routing.module.ts')
-rw-r--r--client/src/app/app-routing.module.ts20
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 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' 2import { RouteReuseStrategy, RouterModule, Routes, UrlMatchResult, UrlSegment } from '@angular/router'
3import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' 3import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
4import { MenuGuards } from '@app/core/routing/menu-guard.service' 4import { MenuGuards } from '@app/core/routing/menu-guard.service'
5import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n' 5import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n'
6import { PreloadSelectedModulesList } from './core' 6import { PreloadSelectedModulesList } from './core'
7import { EmptyComponent } from './empty.component' 7import { EmptyComponent } from './empty.component'
8import { ActorsComponent } from './+actors/actors.component' 8import { RootComponent } from './root.component'
9 9
10const routes: Routes = [ 10const 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: '',