diff --git a/src/components/StakingVaults/EarnOpportunities.tsx b/src/components/StakingVaults/EarnOpportunities.tsx index 068cfbfd3b9..e320c2f60b7 100644 --- a/src/components/StakingVaults/EarnOpportunities.tsx +++ b/src/components/StakingVaults/EarnOpportunities.tsx @@ -5,6 +5,7 @@ import qs from 'qs' import { useCallback, useEffect, useMemo } from 'react' import { useLocation } from 'react-router-dom' +import { useFetchOpportunities } from './hooks/useFetchOpportunities' import { StakingTable } from './StakingTable' import { Text } from '@/components/Text' @@ -30,6 +31,9 @@ type EarnOpportunitiesProps = { } export const EarnOpportunitiesContent = ({ assetId, accountId }: EarnOpportunitiesProps) => { + // Account/asset pages render this section without the earn dashboard mounted, so fetch here too + useFetchOpportunities() + const { navigate } = useBrowserRouter() const location = useLocation() const { diff --git a/src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Status.tsx b/src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Status.tsx index f25e6402c0d..3eec51340ea 100644 --- a/src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Status.tsx +++ b/src/features/defi/providers/runepool/components/RunePoolManager/Deposit/components/Status.tsx @@ -97,10 +97,10 @@ export const Status: React.FC = ({ accountId }) => { }, [accountId, appDispatch, contextDispatch, getOpportunitiesUserData, state?.txid]) const handleViewPosition = useCallback(() => { - if (!accountId) return - // The full-page earn dashboard is mobile-only - the account page shows the position on both layouts - navigate(`/accounts/${accountId}`) - }, [accountId, navigate]) + if (!accountId || !assetId) return + // The full-page earn dashboard is mobile-only - the asset account page shows the position on both layouts + navigate(`/accounts/${accountId}/${assetId}`) + }, [accountId, assetId, navigate]) const handleCancel = useCallback(() => { navigate(-1) diff --git a/src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Status.tsx b/src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Status.tsx index 7b7fe612019..c0dac51fd5b 100644 --- a/src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Status.tsx +++ b/src/features/defi/providers/runepool/components/RunePoolManager/Withdraw/components/Status.tsx @@ -98,10 +98,10 @@ export const Status: React.FC = ({ accountId }) => { }, [accountId, appDispatch, contextDispatch, getOpportunitiesUserData, state?.txid]) const handleViewPosition = useCallback(() => { - if (!accountId) return - // The full-page earn dashboard is mobile-only - the account page shows the position on both layouts - navigate(`/accounts/${accountId}`) - }, [accountId, navigate]) + if (!accountId || !assetId) return + // The full-page earn dashboard is mobile-only - the asset account page shows the position on both layouts + navigate(`/accounts/${accountId}/${assetId}`) + }, [accountId, assetId, navigate]) const handleCancel = useCallback(() => { navigate(-1)