Blockchain component: display dash when feerate is undefined
This commit is contained in:
		
							parent
							
								
									0acb797494
								
							
						
					
					
						commit
						df7f1cc86b
					
				| @ -26,7 +26,7 @@ | |||||||
|             </div> |             </div> | ||||||
|             <ng-template #emptyfees> |             <ng-template #emptyfees> | ||||||
|               <div [attr.data-cy]="'bitcoin-block-offset=' + offset + '-index-' + i + '-fees'" class="fees"> |               <div [attr.data-cy]="'bitcoin-block-offset=' + offset + '-index-' + i + '-fees'" class="fees"> | ||||||
|                   |                 <app-fee-rate unitClass=""></app-fee-rate> | ||||||
|               </div> |               </div> | ||||||
|             </ng-template> |             </ng-template> | ||||||
|             <div [attr.data-cy]="'bitcoin-block-' + offset + '-index-' + i + '-fee-span'" class="fee-span" |             <div [attr.data-cy]="'bitcoin-block-' + offset + '-index-' + i + '-fee-span'" class="fee-span" | ||||||
| @ -37,7 +37,7 @@ | |||||||
|             </div> |             </div> | ||||||
|             <ng-template #emptyfeespan> |             <ng-template #emptyfeespan> | ||||||
|               <div [attr.data-cy]="'bitcoin-block-offset=' + offset + '-index-' + i + '-fees'" class="fee-span"> |               <div [attr.data-cy]="'bitcoin-block-offset=' + offset + '-index-' + i + '-fees'" class="fee-span"> | ||||||
|                   |                 <app-fee-rate unitClass=""></app-fee-rate> | ||||||
|               </div> |               </div> | ||||||
|             </ng-template> |             </ng-template> | ||||||
|             <div [attr.data-cy]="'bitcoin-block-' + offset + '-index-' + i + '-total-fees'" *ngIf="showMiningInfo" |             <div [attr.data-cy]="'bitcoin-block-' + offset + '-index-' + i + '-total-fees'" *ngIf="showMiningInfo" | ||||||
|  | |||||||
| @ -1,4 +1,10 @@ | |||||||
| <ng-container *ngIf="rateUnits$ | async as units"> | <ng-container *ngIf="rateUnits$ | async as units"> | ||||||
|  |   <ng-container *ngIf="fee !== undefined; else noFee"> | ||||||
|     <ng-container *ngIf="units !== 'wu'">{{ fee / (weight / 4) | feeRounding:rounding }} <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></ng-container> |     <ng-container *ngIf="units !== 'wu'">{{ fee / (weight / 4) | feeRounding:rounding }} <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></ng-container> | ||||||
|     <ng-container *ngIf="units === 'wu'">{{ fee / weight | feeRounding:rounding }} <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-weight-units|sat/WU">sat/WU</span></ng-container> |     <ng-container *ngIf="units === 'wu'">{{ fee / weight | feeRounding:rounding }} <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-weight-units|sat/WU">sat/WU</span></ng-container> | ||||||
|  |   </ng-container> | ||||||
|  |   <ng-template #noFee> | ||||||
|  |       <ng-container *ngIf="units !== 'wu'">- <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-vbyte|sat/vB">sat/vB</span></ng-container> | ||||||
|  |       <ng-container *ngIf="units === 'wu'">- <span *ngIf="showUnit" [class]="unitClass" [style]="unitStyle" i18n="shared.sat-weight-units|sat/WU">sat/WU</span></ng-container> | ||||||
|  |   </ng-template> | ||||||
| </ng-container> | </ng-container> | ||||||
| @ -8,7 +8,7 @@ import { StateService } from '../../../services/state.service'; | |||||||
|   styleUrls: ['./fee-rate.component.scss'] |   styleUrls: ['./fee-rate.component.scss'] | ||||||
| }) | }) | ||||||
| export class FeeRateComponent implements OnInit { | export class FeeRateComponent implements OnInit { | ||||||
|   @Input() fee: number; |   @Input() fee: number | undefined; | ||||||
|   @Input() weight: number = 4; |   @Input() weight: number = 4; | ||||||
|   @Input() rounding: string = null; |   @Input() rounding: string = null; | ||||||
|   @Input() showUnit: boolean = true; |   @Input() showUnit: boolean = true; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user