From 37166e230d4723efec5c48c448ebbccde41ed265 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 26 Feb 2020 21:11:43 +0700 Subject: [PATCH] Confirmed address transactions fix. QR Code fix. --- .../src/app/components/address/address.component.ts | 4 ++++ .../src/app/components/qrcode/qrcode.component.ts | 13 +++++++------ .../transactions-list.component.html | 2 +- .../transactions-list.component.ts | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/components/address/address.component.ts b/frontend/src/app/components/address/address.component.ts index e70dda535..d42569194 100644 --- a/frontend/src/app/components/address/address.component.ts +++ b/frontend/src/app/components/address/address.component.ts @@ -61,6 +61,10 @@ export class AddressComponent implements OnInit, OnDestroy { this.stateService.mempoolTransactions$ .subscribe((transaction) => { + if (this.transactions.some((t) => t.txid === transaction.txid)) { + return; + } + this.transactions.unshift(transaction); this.transactions = this.transactions.slice(); this.txCount++; diff --git a/frontend/src/app/components/qrcode/qrcode.component.ts b/frontend/src/app/components/qrcode/qrcode.component.ts index 1c1608a5d..9559fc367 100644 --- a/frontend/src/app/components/qrcode/qrcode.component.ts +++ b/frontend/src/app/components/qrcode/qrcode.component.ts @@ -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() { - } - } diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.html b/frontend/src/app/components/transactions-list/transactions-list.component.html index 909eb53d6..d2698c104 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.html +++ b/frontend/src/app/components/transactions-list/transactions-list.component.html @@ -71,7 +71,7 @@ - + diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index fc130bef8..522b0caf5 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -63,6 +63,6 @@ export class TransactionsListComponent implements OnInit, OnChanges { } trackByFn(index: number, tx: Transaction) { - return tx.txid; + return tx.txid + tx.status.confirmed; } }