Skip to content

Commit 1973f6d

Browse files
authored
Merge pull request #5580 from VenusProtocol/fix/ignore-sunset-filter
fix: ignore sunset filter top borrow & top supply data
2 parents 378a0c7 + 107d2e2 commit 1973f6d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.changeset/real-impalas-cut.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@venusprotocol/evm": patch
3+
---
4+
5+
fix: ignore sunset chain top borrow top supply filter

apps/evm/src/pages/Landing/Hero/HeroTabs/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ import { ButtonGroup } from 'components';
55
import { useChain } from 'hooks/useChain';
66
import { type Tab, useTabs } from 'hooks/useTabs';
77
import { useTranslation } from 'libs/translations';
8-
import { useAccountAddress } from 'libs/wallet';
8+
import { useAccountAddress, useChainId } from 'libs/wallet';
99
import type { Asset } from 'types';
1010
import { getCombinedDistributionApys } from 'utilities';
11+
import { isSunsetChain } from 'utilities/isSunsetChain';
1112
import { GlassCard } from './GlassCard';
1213
import { TabContent } from './TabContent';
1314

1415
export const HeroTabs: React.FC = () => {
1516
const { t } = useTranslation();
1617

1718
const { corePoolComptrollerContractAddress } = useChain();
19+
const { chainId } = useChainId();
20+
const ignoreDisabledActions = isSunsetChain(chainId);
1821

1922
// TODO: update to fetch top markets across chains
2023
const { accountAddress } = useAccountAddress();
@@ -35,7 +38,7 @@ export const HeroTabs: React.FC = () => {
3538
const assetApys = getCombinedDistributionApys({ asset });
3639

3740
if (
38-
!asset.disabledTokenActions.includes('supply') &&
41+
(ignoreDisabledActions || !asset.disabledTokenActions.includes('supply')) &&
3942
assetApys.totalSupplyApyPercentage.isGreaterThan(
4043
topSupplyAssetApys?.totalSupplyApyPercentage || Number.NEGATIVE_INFINITY,
4144
)
@@ -46,7 +49,7 @@ export const HeroTabs: React.FC = () => {
4649

4750
if (
4851
asset.isBorrowable &&
49-
!asset.disabledTokenActions.includes('borrow') &&
52+
(ignoreDisabledActions || !asset.disabledTokenActions.includes('borrow')) &&
5053
assetApys.totalBorrowApyPercentage.isLessThan(
5154
topBorrowAssetApys?.totalBorrowApyPercentage || Number.POSITIVE_INFINITY,
5255
)

0 commit comments

Comments
 (0)