fix stray space, automatically show more outputs if <5 remaining

This commit is contained in:
Mononaut 2022-11-22 18:05:20 +09:00
parent 6cd1f9e870
commit 01a727a344
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 16 additions and 6 deletions

View File

@ -230,19 +230,29 @@ export class TransactionsListComponent implements OnInit, OnChanges {
}
getVinLimit(tx: Transaction, next = false): number {
let limit;
if ((tx['@vinLimit'] || 0) > this.inputRowLimit) {
return Math.min(tx['@vinLimit'] + (next ? this.showMoreIncrement : 0), tx.vin.length);
limit = Math.min(tx['@vinLimit'] + (next ? this.showMoreIncrement : 0), tx.vin.length);
} else {
return Math.min((next ? this.showMoreIncrement : this.inputRowLimit), tx.vin.length);
limit = Math.min((next ? this.showMoreIncrement : this.inputRowLimit), tx.vin.length);
}
if (tx.vin.length - limit <= 5) {
limit = tx.vin.length;
}
return limit;
}
getVoutLimit(tx: Transaction, next = false): number {
let limit;
if ((tx['@voutLimit'] || 0) > this.outputRowLimit) {
return Math.min(tx['@voutLimit'] + (next ? this.showMoreIncrement : 0), tx.vout.length);
limit = Math.min(tx['@voutLimit'] + (next ? this.showMoreIncrement : 0), tx.vout.length);
} else {
return Math.min((next ? this.showMoreIncrement : this.outputRowLimit), tx.vout.length);
limit = Math.min((next ? this.showMoreIncrement : this.outputRowLimit), tx.vout.length);
}
if (tx.vout.length - limit <= 5) {
limit = tx.vout.length;
}
return limit;
}
ngOnDestroy(): void {