From 8e600ec5fd91c34582494ec56c0c3a9d427956f1 Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 3 Mar 2026 01:51:48 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20\`loadActivePositionData\`=20has=20no=20?= =?UTF-8?q?error=20handling=20=E2=80=94=20silent=20failure=20on=20RPC=20er?= =?UTF-8?q?ror=20(#377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../components/collapse/CollapseActive.vue | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/web-app/src/components/collapse/CollapseActive.vue b/web-app/src/components/collapse/CollapseActive.vue index 9e7cbd6..8b32b94 100644 --- a/web-app/src/components/collapse/CollapseActive.vue +++ b/web-app/src/components/collapse/CollapseActive.vue @@ -35,6 +35,10 @@
+
+ {{ error }} + Retry +
Tax Paid
@@ -117,6 +121,7 @@ const taxDue = ref(0n); const taxPaidGes = ref(); const profit = ref(); const loading = ref(false); +const error = ref(null); const tag = computed(() => { // Compare by index instead of decimal to avoid floating-point issues @@ -214,14 +219,23 @@ async function unstakePosition() { } async function loadActivePositionData() { - //loadTaxDue - taxDue.value = await getTaxDue(props.id); - taxPaidGes.value = weiToNumber(taxDue.value + props.position.taxPaid); + loading.value = true; + error.value = null; + try { + //loadTaxDue + taxDue.value = await getTaxDue(props.id); + taxPaidGes.value = weiToNumber(taxDue.value + props.position.taxPaid); - //loadTotalSupply + //loadTotalSupply - // Calculate issuance earned using kraiken-lib profit calculation - profit.value = calculateActivePositionProfit(props.position.totalSupplyInit, statCollection.kraikenTotalSupply, props.position.share); + // Calculate issuance earned using kraiken-lib profit calculation + profit.value = calculateActivePositionProfit(props.position.totalSupplyInit, statCollection.kraikenTotalSupply, props.position.share); + } catch (err) { + console.error('Failed to load active position data:', err); + error.value = 'Failed to load position data.'; + } finally { + loading.value = false; + } } onMounted(() => { @@ -317,6 +331,13 @@ onMounted(() => { &.profit-stats-total border-top: 2px solid var(--color-font) padding-top: 2px + .collapsed-body--error + display: flex + align-items: center + gap: 8px + color: #f87171 + font-size: 13px + margin-bottom: 8px .collapsed-body--actions .collapse-menu-open display: flex