Confirmed address transactions fix. QR Code fix.

This commit is contained in:
softsimon
2020-02-26 21:11:43 +07:00
parent f9c03f2a98
commit 37166e230d
4 changed files with 13 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ import * as QRCode from 'qrcode/build/qrcode.js';
templateUrl: './qrcode.component.html',
styleUrls: ['./qrcode.component.scss']
})
export class QrcodeComponent implements AfterViewInit, OnDestroy {
export class QrcodeComponent implements AfterViewInit {
@Input() data: string;
@ViewChild('canvas') canvas: ElementRef;
@@ -30,14 +30,15 @@ export class QrcodeComponent implements AfterViewInit, OnDestroy {
return;
}
QRCode.toCanvas(this.canvas.nativeElement, this.data.toUpperCase(), opts, (error: any) => {
const address = this.data;
if (this.data.indexOf('bc1') === 0 || this.data.indexOf('tb1') === 0) {
address.toUpperCase();
}
QRCode.toCanvas(this.canvas.nativeElement, address, opts, (error: any) => {
if (error) {
console.error(error);
}
});
}
ngOnDestroy() {
}
}