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