From db1720e3b4c9b6f1be83ad0ea49a7f5e7d9c59f8 Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 20 May 2022 17:54:06 +0400 Subject: [PATCH] Fixes for Liquid module routing --- frontend/src/app/app-routing.module.ts | 2 +- frontend/src/app/graphs/graphs.routing.module.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index ae5860c78..672d68686 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -500,7 +500,7 @@ if (browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid') { }, { path: '**', - redirectTo: 'all' + redirectTo: 'featured' } ] }, diff --git a/frontend/src/app/graphs/graphs.routing.module.ts b/frontend/src/app/graphs/graphs.routing.module.ts index c8546e876..46649551a 100644 --- a/frontend/src/app/graphs/graphs.routing.module.ts +++ b/frontend/src/app/graphs/graphs.routing.module.ts @@ -7,6 +7,7 @@ import { BlockSizesWeightsGraphComponent } from '../components/block-sizes-weigh import { GraphsComponent } from '../components/graphs/graphs.component'; import { HashrateChartComponent } from '../components/hashrate-chart/hashrate-chart.component'; import { HashrateChartPoolsComponent } from '../components/hashrates-chart-pools/hashrate-chart-pools.component'; +import { LiquidMasterPageComponent } from '../components/liquid-master-page/liquid-master-page.component'; import { MasterPageComponent } from '../components/master-page/master-page.component'; import { MempoolBlockComponent } from '../components/mempool-block/mempool-block.component'; import { MiningDashboardComponent } from '../components/mining-dashboard/mining-dashboard.component'; @@ -17,10 +18,15 @@ import { StatisticsComponent } from '../components/statistics/statistics.compone import { TelevisionComponent } from '../components/television/television.component'; import { DashboardComponent } from '../dashboard/dashboard.component'; +const browserWindow = window || {}; +// @ts-ignore +const browserWindowEnv = browserWindow.__env || {}; +const isLiquid = browserWindowEnv && browserWindowEnv.BASE_MODULE === 'liquid'; + const routes: Routes = [ { path: '', - component: MasterPageComponent, + component: isLiquid ? LiquidMasterPageComponent : MasterPageComponent, children: [ { path: 'mining/pool/:slug',