import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
import { MenuGuards } from '@app/core/routing/menu-guard.service'
import { POSSIBLE_LOCALES } from '@shared/core-utils/i18n'
-import { MetaGuard, PreloadSelectedModulesList } from './core'
+import { HomepageRedirectComponent, MetaGuard, PreloadSelectedModulesList } from './core'
import { EmptyComponent } from './empty.component'
import { USER_USERNAME_REGEX_CHARACTERS } from './shared/form-validators/user-validators'
import { ActorRedirectGuard } from './shared/shared-main'
loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule),
canActivateChild: [ MetaGuard ]
},
+ {
+ path: 'manage',
+ loadChildren: () => import('./+manage/manage.module').then(m => m.ManageModule),
+ canActivateChild: [ MetaGuard ]
+ },
+ {
+ path: 'p',
+ loadChildren: () => import('./+plugin-pages/plugin-pages.module').then(m => m.PluginPagesModule),
+ canActivateChild: [ MetaGuard ]
+ },
{
path: 'about',
{
path: 'videos/upload',
loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
+ canActivateChild: [ MetaGuard ],
data: {
meta: {
title: $localize`Upload a video`
{
path: 'videos/update/:uuid',
loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
+ canActivateChild: [ MetaGuard ],
data: {
meta: {
title: $localize`Edit a video`
path: 'w',
loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
data: {
- preload: 3000
+ preload: 5000
}
},
{
canActivateChild: [ MetaGuard ]
},
+ {
+ path: 'studio',
+ loadChildren: () => import('./+video-studio/video-studio.module').then(m => m.VideoStudioModule),
+ canActivateChild: [ MetaGuard ]
+ },
+
+ {
+ path: 'stats',
+ loadChildren: () => import('./+stats/stats.module').then(m => m.StatsModule),
+ canActivateChild: [ MetaGuard ]
+ },
+
// Matches /@:actorName
{
matcher: (url): UrlMatchResult => {
{
path: '',
- component: EmptyComponent // Avoid 404, app component will redirect dynamically
+ component: HomepageRedirectComponent
}
]
for (const locale of POSSIBLE_LOCALES) {
routes.push({
path: locale,
- component: EmptyComponent
+ component: HomepageRedirectComponent
})
}
imports: [
RouterModule.forRoot(routes, {
useHash: Boolean(history.pushState) === false,
+ // Redefined in app component
scrollPositionRestoration: 'disabled',
preloadingStrategy: PreloadSelectedModulesList,
anchorScrolling: 'disabled'