Don't fully animate when tab is deactivated.

refs #47
This commit is contained in:
softsimon
2020-06-11 01:38:59 +07:00
parent e5a537e240
commit ae7715ea8c
3 changed files with 27 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
blockWidth = 125;
blockPadding = 30;
arrowVisible = false;
tabHidden = true;
rightPosition = 0;
transition = '2s';
@@ -38,6 +39,8 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
) { }
ngOnInit() {
this.stateService.isTabHidden$.subscribe((tabHidden) => this.tabHidden = tabHidden);
this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$
.subscribe((blocks) => {
blocks.forEach((block, i) => {
@@ -65,7 +68,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
this.stateService.blocks$
.subscribe(([block]) => {
if (block.matchRate >= 80) {
if (block.matchRate >= 80 && !this.tabHidden) {
this.blockIndex++;
}
});