Display more accurate price on prevout/spent outputs in bowtie tooltip

This commit is contained in:
natsoni
2024-03-17 16:25:36 +09:00
parent df107d34b4
commit 2dc6f6ff5a
6 changed files with 157 additions and 12 deletions

View File

@@ -8,8 +8,13 @@
}}
</span>
<ng-template #noblockconversion>
<span class="fiat">{{ addPlus && satoshis >= 0 ? '+' : '' }}{{ (conversions[currency] > -1 ? conversions[currency] : 0) * satoshis / 100000000 | fiatCurrency : digitsInfo : currency }}
</span>
<ng-container *ngIf="!forceBlockConversion; else zeroValue">
<span class="fiat">{{ addPlus && satoshis >= 0 ? '+' : '' }}{{ (conversions[currency] > -1 ? conversions[currency] : 0) * satoshis / 100000000 | fiatCurrency : digitsInfo : currency }}
</span>
</ng-container>
</ng-template>
<ng-template #zeroValue>
<span class="fiat">{{ 0 | fiatCurrency : digitsInfo : currency }}</span>
</ng-template>
</ng-container>

View File

@@ -24,6 +24,7 @@ export class AmountComponent implements OnInit, OnDestroy {
@Input() addPlus = false;
@Input() blockConversion: Price;
@Input() forceBtc: boolean = false;
@Input() forceBlockConversion: boolean = false; // true = displays fiat price as 0 if blockConversion is undefined instead of falling back to conversions
constructor(
private stateService: StateService,