fix squashed tx flow diagram

This commit is contained in:
Mononaut
2022-11-22 16:30:04 +09:00
parent c659fe2b80
commit 48fc28f415
3 changed files with 7 additions and 4 deletions

View File

@@ -204,7 +204,7 @@
<tx-bowtie-graph
[tx]="tx"
[width]="graphWidth"
[height]="graphExpanded ? (maxInOut * 15) : graphHeight"
[height]="graphHeight"
[lineLimit]="inOutLimit"
[maxStrands]="graphExpanded ? maxInOut : 24"
[network]="network"

View File

@@ -226,6 +226,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.waitingForTransaction = false;
this.setMempoolBlocksSubscription();
this.websocketService.startTrackTransaction(tx.txid);
this.graphExpanded = false;
this.setupGraph();
if (!tx.status.confirmed && tx.firstSeen) {
@@ -364,7 +365,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
setupGraph() {
this.maxInOut = Math.min(this.inOutLimit, Math.max(this.tx?.vin?.length || 1, this.tx?.vout?.length + 1 || 1));
this.graphHeight = Math.min(360, this.maxInOut * 80);
this.graphHeight = this.graphExpanded ? this.maxInOut * 15 : Math.min(360, this.maxInOut * 80);
}
toggleGraph() {
@@ -384,10 +385,12 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
expandGraph() {
this.graphExpanded = true;
this.graphHeight = this.maxInOut * 15;
}
collapseGraph() {
this.graphExpanded = false;
this.graphHeight = Math.min(360, this.maxInOut * 80);
}
// simulate normal anchor fragment behavior