Confirmed address transactions fix. QR Code fix.
This commit is contained in:
		
							parent
							
								
									f9c03f2a98
								
							
						
					
					
						commit
						37166e230d
					
				@ -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++;
 | 
			
		||||
 | 
			
		||||
@ -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() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -71,7 +71,7 @@
 | 
			
		||||
            <tr>
 | 
			
		||||
              <td class="text-right" colspan="4">
 | 
			
		||||
                <span *ngIf="showConfirmations && latestBlock$ | async as latestBlock">
 | 
			
		||||
                  <button *ngIf="tx.status.confirmed; else unconfirmedButton" type="button" class="btn btn-sm btn-success mt-3">{{ latestBlock.height - tx.status.block_height + 1 }} confirmations</button>
 | 
			
		||||
                  <button *ngIf="tx.status.confirmed; else unconfirmedButton" type="button" class="btn btn-sm btn-success mt-3">{{ latestBlock.height - tx.status.block_height + 1 }} confirmation<ng-container *ngIf="latestBlock.height - tx.status.block_height + 1 > 1">s</ng-container></button>
 | 
			
		||||
                  <ng-template #unconfirmedButton>
 | 
			
		||||
                    <button type="button" class="btn btn-sm btn-danger mt-3">Unconfirmed</button>
 | 
			
		||||
                  </ng-template>
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,6 @@ export class TransactionsListComponent implements OnInit, OnChanges {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackByFn(index: number, tx: Transaction) {
 | 
			
		||||
    return tx.txid;
 | 
			
		||||
    return tx.txid + tx.status.confirmed;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user