Small fixes.
This commit is contained in:
parent
05d4eb7696
commit
9a8740cbe0
@ -35,8 +35,9 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$
|
this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$
|
||||||
.subscribe((blocks) => {
|
.subscribe((blocks) => {
|
||||||
this.mempoolBlocksFull = JSON.parse(JSON.stringify(blocks));
|
const stringifiedBlocks = JSON.stringify(blocks);
|
||||||
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(blocks);
|
this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
|
||||||
|
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
|
||||||
this.calculateTransactionPosition();
|
this.calculateTransactionPosition();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, Input, ChangeDetectorRef } from '@angular/core';
|
import { Component, OnInit, OnDestroy, ChangeDetectionStrategy, Input, ChangeDetectorRef, OnChanges } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-time-since',
|
selector: 'app-time-since',
|
||||||
template: `{{ text }}`,
|
template: `{{ text }}`,
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class TimeSinceComponent implements OnInit, OnDestroy {
|
export class TimeSinceComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
interval: number;
|
interval: number;
|
||||||
text: string;
|
text: string;
|
||||||
|
|
||||||
@ -17,13 +17,17 @@ export class TimeSinceComponent implements OnInit, OnDestroy {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.text = this.calculate();
|
|
||||||
this.interval = window.setInterval(() => {
|
this.interval = window.setInterval(() => {
|
||||||
this.text = this.calculate();
|
this.text = this.calculate();
|
||||||
this.ref.markForCheck();
|
this.ref.markForCheck();
|
||||||
}, 1000 * (this.fastRender ? 1 : 60));
|
}, 1000 * (this.fastRender ? 1 : 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnChanges() {
|
||||||
|
this.text = this.calculate();
|
||||||
|
this.ref.markForCheck();
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user