SSR: solve block page initial state

This commit is contained in:
Mononaut 2023-10-29 18:21:13 +00:00
parent 4fbbff6614
commit ab5ee5370a
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,6 @@ import { ZONE_SERVICE } from './injection-tokens';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
import { AppComponent } from './components/app/app.component'; import { AppComponent } from './components/app/app.component';
import { HttpCacheInterceptor } from './services/http-cache.interceptor'; import { HttpCacheInterceptor } from './services/http-cache.interceptor';
import { StateService } from './services/state.service';
import { ZoneService } from './services/zone.service'; import { ZoneService } from './services/zone.service';

View File

@ -1,4 +1,4 @@
import { Component, OnInit, OnDestroy, ViewChildren, QueryList, Inject, PLATFORM_ID } from '@angular/core'; import { Component, OnInit, OnDestroy, ViewChildren, QueryList, Inject, PLATFORM_ID, ChangeDetectorRef } from '@angular/core';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { ElectrsApiService } from '../../services/electrs-api.service'; import { ElectrsApiService } from '../../services/electrs-api.service';
@ -109,6 +109,7 @@ export class BlockComponent implements OnInit, OnDestroy {
private priceService: PriceService, private priceService: PriceService,
private cacheService: CacheService, private cacheService: CacheService,
private servicesApiService: ServicesApiServices, private servicesApiService: ServicesApiServices,
private cd: ChangeDetectorRef,
@Inject(PLATFORM_ID) private platformId: Object, @Inject(PLATFORM_ID) private platformId: Object,
) { ) {
this.webGlEnabled = isPlatformServer(this.platformId) || detectWebGL(); this.webGlEnabled = isPlatformServer(this.platformId) || detectWebGL();
@ -320,6 +321,7 @@ export class BlockComponent implements OnInit, OnDestroy {
} }
this.transactions = transactions; this.transactions = transactions;
this.isLoadingTransactions = false; this.isLoadingTransactions = false;
this.cd.markForCheck();
}, },
(error) => { (error) => {
this.error = error; this.error = error;
@ -473,6 +475,7 @@ export class BlockComponent implements OnInit, OnDestroy {
this.isLoadingOverview = false; this.isLoadingOverview = false;
this.setupBlockGraphs(); this.setupBlockGraphs();
this.cd.markForCheck();
}); });
this.oobSubscription = block$.pipe( this.oobSubscription = block$.pipe(