diff --git a/web-app/src/components/collapse/CollapseActive.vue b/web-app/src/components/collapse/CollapseActive.vue
index 688bd23..6b6f9ca 100644
--- a/web-app/src/components/collapse/CollapseActive.vue
+++ b/web-app/src/components/collapse/CollapseActive.vue
@@ -39,6 +39,9 @@
{{ error }}
Retry
+
+ {{ unstakeError }}
+
Tax Cost
@@ -122,6 +125,7 @@ const taxPaidGes = ref
();
const profit = ref();
const loading = ref(false);
const error = ref(null);
+const unstakeError = ref(null);
const tag = computed(() => {
// Compare by index instead of decimal to avoid floating-point issues
@@ -214,9 +218,11 @@ async function changeTax(id: bigint, nextTaxRateIndex: number | null) {
}
async function unstakePosition() {
- error.value = null;
+ unstakeError.value = null;
+ let exitSucceeded = false;
try {
await unstake.exitPosition(props.id);
+ exitSucceeded = true;
loading.value = true;
const POLL_INTERVAL_MS = 1000;
const TIMEOUT_MS = 30_000;
@@ -230,8 +236,10 @@ async function unstakePosition() {
await loadPositions(currentChainId.value);
} catch (err) {
// eslint-disable-next-line no-console
- console.error('Failed to unstake position:', err);
- error.value = 'Failed to unstake position.';
+ console.error(exitSucceeded ? 'Failed to refresh positions after unstake:' : 'Failed to unstake position:', err);
+ unstakeError.value = exitSucceeded
+ ? 'Position unstaked, but failed to refresh data.'
+ : 'Failed to unstake position.';
} finally {
loading.value = false;
}