diff --git a/src/components/ClassicElasticTab.tsx b/src/components/ClassicElasticTab.tsx index e6202f2a5e..e8285f4efc 100644 --- a/src/components/ClassicElasticTab.tsx +++ b/src/components/ClassicElasticTab.tsx @@ -45,10 +45,18 @@ function ClassicElasticTab() { const upToMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`) - const showLegacyExplicit = upToMedium ? false : isFarmpage ? shouldShowFarmTab : shouldShowPositionTab - const dontShowLegacy = [ChainId.ZKEVM, ChainId.BASE, ChainId.LINEA].includes(chainId) + const showLegacyExplicit = + upToMedium || dontShowLegacy ? false : isFarmpage ? shouldShowFarmTab : shouldShowPositionTab + + useEffect(() => { + if (dontShowLegacy && tab === VERSION.ELASTIC_LEGACY) { + const newQs = { ...qs, tab: VERSION.ELASTIC } + navigate({ search: stringify(newQs) }, { replace: true }) + } + }, [tab, dontShowLegacy, navigate, qs]) + const legacyTag = (small?: boolean) => ( { setShowConfirmModal('withdraw') diff --git a/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx b/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx index 7fb9f2b562..efacd484e4 100644 --- a/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx +++ b/src/pages/MyEarnings/ElasticPools/SinglePosition/PositionView.tsx @@ -275,7 +275,7 @@ const PositionView: React.FC = props => { } /> ) : ( - -- + $0 )} @@ -315,10 +315,12 @@ const PositionView: React.FC = props => { {+positionEarning.pendingRewardUSD ? formatDisplayNumber(positionEarning.pendingRewardUSD, { style: 'currency', significantDigits: 6 }) + : farmRewards?.length + ? '$0' : '--'} } - disabled={!+positionEarning.pendingRewardUSD} + disabled={disabledHarvest} text={ <> {farmRewards?.map((rw, index) => (