Add show all toggle for redeem scripts

This commit is contained in:
natsoni
2024-06-06 11:43:21 +02:00
parent 9b9aaed757
commit f840ac951b
3 changed files with 23 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
transactionsLength: number = 0;
inputRowLimit: number = 12;
outputRowLimit: number = 12;
showFullScript: { [vinIndex: number]: boolean } = {};
constructor(
public stateService: StateService,
@@ -300,7 +301,9 @@ export class TransactionsListComponent implements OnInit, OnChanges {
toggleDetails(): void {
if (this.showDetails$.value === true) {
this.showDetails$.next(false);
this.showFullScript = {};
} else {
this.showFullScript = this.transactions[0] ? this.transactions[0].vin.reduce((acc, _, i) => ({...acc, [i]: false}), {}) : {};
this.showDetails$.next(true);
}
}
@@ -352,6 +355,10 @@ export class TransactionsListComponent implements OnInit, OnChanges {
return limit;
}
toggleShowFullScript(vinIndex: number): void {
this.showFullScript[vinIndex] = !this.showFullScript[vinIndex];
}
ngOnDestroy(): void {
this.outspendsSubscription.unsubscribe();
this.currencyChangeSubscription?.unsubscribe();