[accelerator] ln qr

This commit is contained in:
Mononaut 2024-06-30 07:17:15 +00:00
parent 1e820a0fc8
commit 3ecc8ae8cf
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,7 @@
<form [formGroup]="paymentForm"> <form [formGroup]="paymentForm">
<div class="form-group"> <div *ngIf="availableMethods.length > 1" class="form-group">
<div class="btn-group btn-group-toggle" data-toggle="buttons"> <div class="btn-group btn-group-toggle" data-toggle="buttons">
<!-- <label *ngIf="invoice.addresses.BTC" class="btn btn-primary" [ngClass]="{'active': paymentForm.get('method')?.value === 'chain'}"> <!-- <label *ngIf="invoice.addresses.BTC" class="btn btn-primary" [ngClass]="{'active': paymentForm.get('method')?.value === 'chain'}">
<input type="radio" value="chain" formControlName="method"> <fa-icon [icon]="['fas', 'link']" [fixedWidth]="true" title="Onchain"></fa-icon> <input type="radio" value="chain" formControlName="method"> <fa-icon [icon]="['fas', 'link']" [fixedWidth]="true" title="Onchain"></fa-icon>
@ -54,7 +54,7 @@
<div class="qr-wrapper" [class.mt-0]="minimal"> <div class="qr-wrapper" [class.mt-0]="minimal">
<a [href]="bypassSecurityTrustUrl('lightning:' + invoice.addresses.BTC_LightningLike)" target="_blank"> <a [href]="bypassSecurityTrustUrl('lightning:' + invoice.addresses.BTC_LightningLike)" target="_blank">
<app-qrcode imageUrl="/resources/bitcoin-logo.png" [size]="200" [data]="invoice.addresses.BTC_LightningLike.toUpperCase()"></app-qrcode> <app-qrcode imageUrl="/resources/lightning-logo.png" [size]="200" [data]="invoice.addresses.BTC_LightningLike.toUpperCase()"></app-qrcode>
</a> </a>
</div> </div>

View File

@ -87,6 +87,10 @@ export class BitcoinInvoiceComponent implements OnInit, OnDestroy {
).subscribe(); ).subscribe();
} }
get availableMethods(): string[] {
return Object.keys(this.invoice?.addresses || {}).filter(k => k === 'BTC_LightningLike');
}
bypassSecurityTrustUrl(text: string): SafeUrl { bypassSecurityTrustUrl(text: string): SafeUrl {
return this.sanitizer.bypassSecurityTrustUrl(text); return this.sanitizer.bypassSecurityTrustUrl(text);
} }