Display block details and taproot signaling.

This commit is contained in:
softsimon
2021-05-01 03:55:02 +04:00
parent 0d03a9e6cc
commit d2fe000ad0
6 changed files with 96 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ export class BlockComponent implements OnInit, OnDestroy {
page = 1;
itemsPerPage: number;
txsLoadingStatus$: Observable<number>;
showDetails = false;
constructor(
private route: ActivatedRoute,
@@ -144,6 +145,14 @@ export class BlockComponent implements OnInit, OnDestroy {
this.stateService.networkChanged$
.subscribe((network) => this.network = network);
this.route.queryParams.subscribe((params) => {
if (params.showDetails === 'true') {
this.showDetails = true;
} else {
this.showDetails = false;
}
});
}
ngOnDestroy() {
@@ -175,4 +184,26 @@ export class BlockComponent implements OnInit, OnDestroy {
this.isLoadingTransactions = false;
});
}
toggleShowDetails() {
if (this.showDetails) {
this.showDetails = false;
this.router.navigate([], {
relativeTo: this.route,
queryParams: { showDetails: false },
queryParamsHandling: 'merge',
});
} else {
this.showDetails = true;
this.router.navigate([], {
relativeTo: this.route,
queryParams: { showDetails: true },
queryParamsHandling: 'merge',
});
}
}
hasTaproot(version: number): boolean {
return (Number(version) & (1 << 2)) > 0;
}
}