Merge pull request 'fix: total computed has no undefined guard — shows initial stake amount during loading (#424)' (#488) from fix/issue-424 into master
This commit is contained in:
commit
8c893d68e1
1 changed files with 5 additions and 2 deletions
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
<div class="profit-stats-item profit-stats-total">
|
||||
<div><b>Total</b></div>
|
||||
<div>{{ taxPaidGes !== undefined && profit !== undefined ? formatTokenAmount(total) : '...' }} $KRK</div>
|
||||
<div>{{ total !== undefined ? formatTokenAmount(total) : '...' }} $KRK</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -132,7 +132,10 @@ const tag = computed(() => {
|
|||
return '';
|
||||
});
|
||||
|
||||
const total = computed(() => props.amount + (profit.value ?? 0) - (taxPaidGes.value ?? 0));
|
||||
const total = computed(() => {
|
||||
if (profit.value === undefined || taxPaidGes.value === undefined) return undefined;
|
||||
return props.amount + profit.value - taxPaidGes.value;
|
||||
});
|
||||
|
||||
// P&L calculations (FIXED: Use BigInt math to preserve precision)
|
||||
const grossReturn = computed(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue