Update fee distribution graph and fix arrow.

This commit is contained in:
softsimon
2020-03-20 02:11:40 +07:00
parent e84ec7dd86
commit 4ae5576452
5 changed files with 59 additions and 25 deletions

View File

@@ -91,18 +91,17 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
}
calculateTransactionPosition() {
if ((!this.txFeePerVSize && this.markIndex === -1) || !this.mempoolBlocks) {
if ((!this.txFeePerVSize && (this.markIndex === undefined || this.markIndex === -1)) || !this.mempoolBlocks) {
this.arrowVisible = false;
return;
} else if (this.markIndex > -1) {
this.rightPosition = this.markIndex * (this.blockWidth + this.blockPadding) + 0.5 * this.blockWidth;
this.arrowVisible = true;
return;
}
this.arrowVisible = true;
if (this.markIndex > -1) {
this.rightPosition = this.markIndex * (this.blockWidth + this.blockPadding) + 0.5 * this.blockWidth;
return;
}
for (const block of this.mempoolBlocks) {
for (let i = 0; i < block.feeRange.length - 1; i++) {
if (this.txFeePerVSize < block.feeRange[i + 1] && this.txFeePerVSize >= block.feeRange[i]) {