diff --git a/staking-dashboard/src/components/ClaimDelegationRewardsButton/ClaimDelegationRewardsButton.tsx b/staking-dashboard/src/components/ClaimDelegationRewardsButton/ClaimDelegationRewardsButton.tsx
index ab5996546..738e34c8e 100644
--- a/staking-dashboard/src/components/ClaimDelegationRewardsButton/ClaimDelegationRewardsButton.tsx
+++ b/staking-dashboard/src/components/ClaimDelegationRewardsButton/ClaimDelegationRewardsButton.tsx
@@ -1,4 +1,4 @@
-import { useEffect } from "react"
+import { useEffect, useMemo } from "react"
import { useAccount } from "wagmi"
import { useClaimSplitRewards } from "@/hooks/splits"
import { useStakingAssetTokenDetails } from "@/hooks/stakingRegistry"
@@ -33,11 +33,11 @@ export const ClaimDelegationRewardsButton = ({
const { stakingAssetAddress: tokenAddress } = useStakingAssetTokenDetails()
const { showAlert } = useAlert()
- // Fetch balances for skip logic
+ // Fetch balances for skip logic - extract refetch functions
const { warehouseAddress } = useSplitsWarehouse(splitContract)
- const { rewards: rollupBalance } = useSequencerRewards(splitContract)
- const { balance: splitContractBalance } = useERC20Balance(tokenAddress!, splitContract)
- const { balance: warehouseBalance } = useWarehouseBalance(warehouseAddress, beneficiary, tokenAddress)
+ const { rewards: rollupBalance, refetch: refetchRollup } = useSequencerRewards(splitContract)
+ const { balance: splitContractBalance, refetch: refetchSplitContract } = useERC20Balance(tokenAddress!, splitContract)
+ const { balance: warehouseBalance, refetch: refetchWarehouse } = useWarehouseBalance(warehouseAddress, beneficiary, tokenAddress)
// Calculate split allocations based on provider take rate
const totalAllocation = 10000n
@@ -52,6 +52,16 @@ export const ClaimDelegationRewardsButton = ({
distributionIncentive: 0
}
+ // Memoize balances object to prevent effect re-runs on every render
+ const balances = useMemo(() => ({
+ rollupBalance,
+ splitContractBalance,
+ warehouseBalance,
+ refetchRollup,
+ refetchSplitContract,
+ refetchWarehouse
+ }), [rollupBalance, splitContractBalance, warehouseBalance, refetchRollup, refetchSplitContract, refetchWarehouse])
+
const {
claim,
claimStep,
@@ -65,11 +75,7 @@ export const ClaimDelegationRewardsButton = ({
splitData,
tokenAddress!,
beneficiary as Address,
- {
- rollupBalance,
- splitContractBalance,
- warehouseBalance
- }
+ balances
)
// Call onSuccess callback when claim completes
@@ -79,12 +85,15 @@ export const ClaimDelegationRewardsButton = ({
}
}, [isSuccess, onSuccess])
- // Handle errors
+ // Handle errors - show all errors, not just rejections
useEffect(() => {
if (error) {
const errorMessage = error.message
if (errorMessage.includes('User rejected') || errorMessage.includes('rejected')) {
showAlert('warning', 'Transaction was cancelled')
+ } else {
+ // Show error for all other failures
+ showAlert('error', `Claim failed: ${errorMessage}`)
}
}
}, [error, showAlert])
diff --git a/staking-dashboard/src/components/VestingSchedule/VestingGraph.tsx b/staking-dashboard/src/components/VestingSchedule/VestingGraph.tsx
index 054db07c4..169530181 100644
--- a/staking-dashboard/src/components/VestingSchedule/VestingGraph.tsx
+++ b/staking-dashboard/src/components/VestingSchedule/VestingGraph.tsx
@@ -3,7 +3,6 @@ import type { Address } from "viem"
import { formatTokenAmount } from "@/utils/atpFormatters"
import { useStakingAssetTokenDetails } from "@/hooks/stakingRegistry"
import { useVestingCalculation } from "@/hooks/atp"
-import { isAuctionRegistry } from "@/hooks/atpRegistry"
interface VestingGraphProps {
globalLock: {
@@ -20,12 +19,9 @@ interface VestingGraphProps {
/**
* SVG vector graph showing cliff vesting pattern
*/
-export const VestingGraph = ({ globalLock, registryAddress, className = "" }: VestingGraphProps) => {
+export const VestingGraph = ({ globalLock, className = "" }: VestingGraphProps) => {
const { symbol, decimals } = useStakingAssetTokenDetails()
- // Check if this is an ATP from auction registry
- const isAuctionATP = isAuctionRegistry(registryAddress)
-
// Check for invalid time range
const hasInvalidTimeRange = Number(globalLock.endTime) < Number(globalLock.startTime)
@@ -165,23 +161,6 @@ export const VestingGraph = ({ globalLock, registryAddress, className = "" }: Ve
return (
- {/* TGE Notice for Auction ATP */}
- {isAuctionATP && (
-
-
- TGE Notice: Tokens become available at TGE. TGE is decided by governance. Earliest anticipated in 90 days from start date. Latest is{' '}
-
- {new Date(Number(globalLock.endTime) * 1000).toLocaleDateString('en-US', {
- day: 'numeric',
- month: 'short',
- year: 'numeric'
- })}
-
- {' '}as shown in the graph below.
-
-
- )}
-