diff --git a/src/Blockcore.Explorer/ClientApp/src/app/app.component.ts b/src/Blockcore.Explorer/ClientApp/src/app/app.component.ts index 9e7566a..eed354b 100644 --- a/src/Blockcore.Explorer/ClientApp/src/app/app.component.ts +++ b/src/Blockcore.Explorer/ClientApp/src/app/app.component.ts @@ -1,8 +1,7 @@ import { Component, OnInit, Renderer2 } from '@angular/core'; import { ApiService } from './services/api.service'; import { SetupService } from './services/setup.service'; -import { Router, ActivatedRoute, NavigationEnd, ResolveEnd, NavigationStart } from '@angular/router'; -import { filter } from 'rxjs/operators'; +import { Router, ActivatedRoute } from '@angular/router'; import { ThemeService } from './services/theme.service'; @Component({ @@ -21,9 +20,6 @@ export class AppComponent implements OnInit { private activatedRoute: ActivatedRoute) { this.theme.init(renderer); - - // Initial loading. - this.setup.getChains(); } async ngOnInit() { diff --git a/src/Blockcore.Explorer/ClientApp/src/app/explorer/explorer.component.ts b/src/Blockcore.Explorer/ClientApp/src/app/explorer/explorer.component.ts index 7cd8ffc..1fe594f 100644 --- a/src/Blockcore.Explorer/ClientApp/src/app/explorer/explorer.component.ts +++ b/src/Blockcore.Explorer/ClientApp/src/app/explorer/explorer.component.ts @@ -25,8 +25,10 @@ export class ExplorerComponent implements OnInit, OnDestroy { constructor(private api: ApiService, public setup: SetupService) { this.subscription = this.setup.currentChain$.subscribe(async (chain) => { - await this.updateInfo(); - await this.updateBlocks(); + if (!this.setup.isCurrentRootChain) { + await this.updateInfo(); + await this.updateBlocks(); + } }); } @@ -41,6 +43,10 @@ export class ExplorerComponent implements OnInit, OnDestroy { } async updateBlocks() { + if (this.setup.isCurrentRootChain) { + return; + } + try { const list = await this.api.getBlocks(0, 5); @@ -69,6 +75,10 @@ export class ExplorerComponent implements OnInit, OnDestroy { } async updateInfo() { + if (this.setup.isCurrentRootChain) { + return; + } + try { this.info = await this.api.getInfo(); diff --git a/src/Blockcore.Explorer/ClientApp/src/app/nav-menu/nav-menu.component.html b/src/Blockcore.Explorer/ClientApp/src/app/nav-menu/nav-menu.component.html index a1b1e68..c1e3a15 100644 --- a/src/Blockcore.Explorer/ClientApp/src/app/nav-menu/nav-menu.component.html +++ b/src/Blockcore.Explorer/ClientApp/src/app/nav-menu/nav-menu.component.html @@ -1,19 +1,19 @@ -