fix: CollapseHistory: show "—" instead of "0" profit when data unavailable (#207)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-02-24 19:54:15 +00:00
parent 1bc01c0555
commit ff29f79d8a

View file

@ -25,7 +25,7 @@
</div>
<div>
<span class="subheader2">Profit</span><span class="number-small">{{ profit }}</span
><span class="caption"> $KRK</span>
><span v-if="profit !== '—'" class="caption"> $KRK</span>
</div>
<template v-if="isSnatched">
<div v-if="payoutKrk !== null">
@ -62,7 +62,7 @@ const isSnatched = computed(() => props.position.snatched > 0);
const profit = computed(() => {
if (!props.position.totalSupplyEnd) {
return 0;
return '—';
}
return calculateClosedPositionProfit(props.position.totalSupplyInit, props.position.totalSupplyEnd, props.position.share);
});