@@ -2,6 +2,9 @@ import { NgModule } from '@angular/core';
22import { NoPreloading , RouterModule , Routes } from '@angular/router' ;
33import { CONFIG , getFirstFeature } from '@shared/constants/config' ;
44import { WebNodeLandingPageComponent } from '@app/layout/web-node-landing-page/web-node-landing-page.component' ;
5+ import { getMergedRoute , MergedRoute } from '@openmina/shared' ;
6+ import { filter , take } from 'rxjs' ;
7+ import { landingPageGuard } from '@shared/guards/landing-page.guard' ;
58
69const APP_TITLE : string = 'Open Mina' ;
710
@@ -24,6 +27,7 @@ function generateRoutes(): Routes {
2427 path : 'dashboard' ,
2528 loadChildren : ( ) => import ( '@dashboard/dashboard.module' ) . then ( m => m . DashboardModule ) ,
2629 title : DASHBOARD_TITLE ,
30+ canActivate : [ landingPageGuard ] ,
2731 } ,
2832 {
2933 path : 'nodes' ,
@@ -45,6 +49,7 @@ function generateRoutes(): Routes {
4549 path : 'state' ,
4650 loadChildren : ( ) => import ( '@state/state.module' ) . then ( m => m . StateModule ) ,
4751 title : STATE_TITLE ,
52+ canActivate : [ landingPageGuard ] ,
4853 } ,
4954 {
5055 path : 'snarks' ,
@@ -55,16 +60,19 @@ function generateRoutes(): Routes {
5560 path : 'block-production' ,
5661 loadChildren : ( ) => import ( '@block-production/block-production.module' ) . then ( m => m . BlockProductionModule ) ,
5762 title : BLOCK_PRODUCTION_TITLE ,
63+ canActivate : [ landingPageGuard ] ,
5864 } ,
5965 {
6066 path : 'mempool' ,
6167 loadChildren : ( ) => import ( '@mempool/mempool.module' ) . then ( m => m . MempoolModule ) ,
6268 title : MEMPOOL_TITLE ,
69+ canActivate : [ landingPageGuard ] ,
6370 } ,
6471 {
6572 path : 'benchmarks' ,
6673 loadChildren : ( ) => import ( '@benchmarks/benchmarks.module' ) . then ( m => m . BenchmarksModule ) ,
6774 title : BENCHMARKS_TITLE ,
75+ canActivate : [ landingPageGuard ] ,
6876 } ,
6977 {
7078 path : 'fuzzing' ,
@@ -75,12 +83,19 @@ function generateRoutes(): Routes {
7583 path : 'loading-web-node' ,
7684 loadChildren : ( ) => import ( '@web-node/web-node.module' ) . then ( m => m . WebNodeModule ) ,
7785 title : WEBNODE_TITLE ,
86+ canActivate : [ landingPageGuard ] ,
7887 } ,
79- {
88+ // {
89+ // path: '',
90+ // loadChildren: () => import('@leaderboard/leaderboard.module').then(m => m.LeaderboardModule),
91+ // },
92+ ] ;
93+ if ( CONFIG . showLeaderboard ) {
94+ routes . push ( {
8095 path : '' ,
8196 loadChildren : ( ) => import ( '@leaderboard/leaderboard.module' ) . then ( m => m . LeaderboardModule ) ,
82- } ,
83- ] ;
97+ } ) ;
98+ }
8499 if ( CONFIG . showWebNodeLandingPage ) {
85100 routes . push ( {
86101 path : '' ,
0 commit comments