From e6d17ea9dc33a7440dcd3620d7fd9b887bf7e7b6 Mon Sep 17 00:00:00 2001
From: Majorfi
Date: Mon, 2 Dec 2024 15:37:31 +0100
Subject: [PATCH] fix: crash
---
apps/vaults-v3/components/details/RewardsTab.tsx | 2 +-
.../components/details/VaultActionsTabsWrapper.tsx | 14 +++++++-------
.../components/details/VaultActionsTabsWrapper.tsx | 3 ++-
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/apps/vaults-v3/components/details/RewardsTab.tsx b/apps/vaults-v3/components/details/RewardsTab.tsx
index 8d4f4c021..42166ab41 100644
--- a/apps/vaults-v3/components/details/RewardsTab.tsx
+++ b/apps/vaults-v3/components/details/RewardsTab.tsx
@@ -368,7 +368,7 @@ export function RewardsTab(props: {currentVault: TYDaemonVault; hasStakingReward
className={'w-full md:w-1/3'}
legend={
-
{`${formatAmount(vaultData.stakedEarned.normalized, 6)} ${rewardTokenBalance.symbol || (props.currentVault.staking.rewards || [])[0].symbol || ''} available to claim`}
+
{`${formatAmount(vaultData.stakedEarned.normalized, 6)} ${rewardTokenBalance.symbol || (props.currentVault.staking.rewards || [])[0]?.symbol || ''} available to claim`}
{`${formatCounterValue(vaultData.stakedEarned.normalized, rewardTokenPrice.normalized)}`}
}
diff --git a/apps/vaults-v3/components/details/VaultActionsTabsWrapper.tsx b/apps/vaults-v3/components/details/VaultActionsTabsWrapper.tsx
index e30e52494..09eb80ed3 100755
--- a/apps/vaults-v3/components/details/VaultActionsTabsWrapper.tsx
+++ b/apps/vaults-v3/components/details/VaultActionsTabsWrapper.tsx
@@ -266,9 +266,9 @@ export function VaultDetailsTab(props: {
{props.tab.label === 'Boost' && toBigInt(props.unstakedBalance?.raw) > 0n ? (
-
+
) : null}
@@ -493,7 +493,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
-
+
{'Looks like this is an old vault.'}
{
@@ -511,7 +511,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
-
+
{'This Vault is no longer supported (oh no).'}
{
@@ -526,7 +526,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
-
+
{'Oh look, an important message for you to read!'}
-
+
@@ -652,7 +652,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
)}
- {currentTab.value !== 3 && (
+ {currentTab.value !== 3 && currentVault.staking.rewards && (
{currentVault?.migration?.available && (
@@ -340,7 +341,7 @@ export function VaultActionsTabsWrapper({currentVault}: {currentVault: TYDaemonV
)}
- {currentTab.value !== 3 && (
+ {currentTab.value !== 3 && currentVault.staking.rewards && (