Clear interval on destroy and remove commented code
This commit is contained in:
parent
5e8b5e75d8
commit
9ac45a6cc3
@ -28,9 +28,6 @@
|
|||||||
<div class="shape-border waiting">
|
<div class="shape-border waiting">
|
||||||
<div class="shape animate"></div>
|
<div class="shape animate"></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div>
|
|
||||||
<span class="symbol">< </span><app-fee-rate [fee]="tx.effectiveFeePerVsize" [unitStyle]="{ display: 'block', marginTop: '-0.5em'}"></app-fee-rate>
|
|
||||||
</div> -->
|
|
||||||
<div class="status"><span class="badge badge-waiting" i18n="transaction.rbf.mined">Mined</span></div>
|
<div class="status"><span class="badge badge-waiting" i18n="transaction.rbf.mined">Mined</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,6 +20,7 @@ export class AccelerationTimelineComponent implements OnInit, OnChanges {
|
|||||||
now: number;
|
now: number;
|
||||||
accelerateRatio: number;
|
accelerateRatio: number;
|
||||||
useAbsoluteTime: boolean = false;
|
useAbsoluteTime: boolean = false;
|
||||||
|
interval: number;
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ export class AccelerationTimelineComponent implements OnInit, OnChanges {
|
|||||||
this.now = Math.floor(new Date().getTime() / 1000);
|
this.now = Math.floor(new Date().getTime() / 1000);
|
||||||
this.useAbsoluteTime = this.tx.status.block_time < this.now - 7 * 24 * 3600;
|
this.useAbsoluteTime = this.tx.status.block_time < this.now - 7 * 24 * 3600;
|
||||||
|
|
||||||
window.setInterval(() => {
|
this.interval = window.setInterval(() => {
|
||||||
this.now = Math.floor(new Date().getTime() / 1000);
|
this.now = Math.floor(new Date().getTime() / 1000);
|
||||||
this.useAbsoluteTime = this.tx.status.block_time < this.now - 7 * 24 * 3600;
|
this.useAbsoluteTime = this.tx.status.block_time < this.now - 7 * 24 * 3600;
|
||||||
}, 60000);
|
}, 60000);
|
||||||
@ -47,4 +48,8 @@ export class AccelerationTimelineComponent implements OnInit, OnChanges {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
clearInterval(this.interval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user