Skip to content
Snippets Groups Projects
Commit d897b03f authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: add change detection to splash screen

parent 83835142
No related branches found
No related tags found
No related merge requests found
import { Component, ElementRef, Pipe, PipeTransform, ViewChild } from "@angular/core";
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Pipe, PipeTransform, ViewChild } from "@angular/core";
import { MatSnackBar } from "@angular/material/snack-bar";
import { select, Store } from "@ngrx/store";
import { Observable, Subject, Subscription } from "rxjs";
......@@ -13,6 +13,7 @@ import { CONST } from 'common/constants'
styleUrls : [
`./splashScreen.style.css`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SplashScreen {
......@@ -33,10 +34,14 @@ export class SplashScreen {
constructor(
private store: Store<any>,
private snack: MatSnackBar,
private pureConstantService: PureContantService
private pureConstantService: PureContantService,
private cdr: ChangeDetectorRef,
) {
this.subscriptions.push(
this.pureConstantService.allFetchingReady$.subscribe(flag => this.finishedLoading = flag)
this.pureConstantService.allFetchingReady$.subscribe(flag => {
this.finishedLoading = flag
this.cdr.markForCheck()
})
)
this.loadedAtlases$ = this.store.pipe(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment