From 0063e9400783baeba940cc849e522efeabd1305f Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 6 Mar 2026 06:31:49 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20\`total\`=20computed=20has=20no=20undefi?= =?UTF-8?q?ned=20guard=20=E2=80=94=20shows=20initial=20stake=20amount=20du?= =?UTF-8?q?ring=20loading=20(#424)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When profit or taxPaidGes were undefined (data still loading), the computed returned props.amount due to the ?? 0 fallbacks. The computed now returns undefined until both values are loaded, and the template guard is simplified to total !== undefined. Co-Authored-By: Claude Sonnet 4.6 --- web-app/src/components/collapse/CollapseActive.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web-app/src/components/collapse/CollapseActive.vue b/web-app/src/components/collapse/CollapseActive.vue index dd7798e..bbeb8a3 100644 --- a/web-app/src/components/collapse/CollapseActive.vue +++ b/web-app/src/components/collapse/CollapseActive.vue @@ -50,7 +50,7 @@
Total
-
{{ taxPaidGes !== undefined && profit !== undefined ? formatTokenAmount(total) : '...' }} $KRK
+
{{ total !== undefined ? formatTokenAmount(total) : '...' }} $KRK
@@ -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(() => {