Skip to content

Commit

Permalink
add feature check
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Apr 25, 2023
1 parent becbca3 commit 3230e44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/pages/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';

import type { RoutedTab } from 'ui/shared/RoutedTabs/types';

import appConfig from 'configs/app/config';
import useApiQuery from 'lib/api/useApiQuery';
import { useAppContext } from 'lib/appContext';
import useIsMobile from 'lib/hooks/useIsMobile';
Expand Down Expand Up @@ -49,7 +50,7 @@ const BlockPageContent = () => {
resourceName: 'block_withdrawals',
pathParams: { height },
options: {
enabled: Boolean(blockQuery.data?.height && tab === 'withdrawals'),
enabled: Boolean(blockQuery.data?.height && appConfig.beaconChain.hasBeaconChain && tab === 'withdrawals'),
},
});

Expand All @@ -64,7 +65,7 @@ const BlockPageContent = () => {
const tabs: Array<RoutedTab> = React.useMemo(() => ([
{ id: 'index', title: 'Details', component: <BlockDetails query={ blockQuery }/> },
{ id: 'txs', title: 'Transactions', component: <TxsContent query={ blockTxsQuery } showBlockInfo={ false } showSocketInfo={ false }/> },
blockQuery.data?.has_beacon_chain_withdrawals ?
appConfig.beaconChain.hasBeaconChain && blockQuery.data?.has_beacon_chain_withdrawals ?
{ id: 'withdrawals', title: 'Withdrawals', component: <BlockWithdrawals blockWithdrawalsQuery={ blockWithdrawalsQuery }/> } :
null,
].filter(Boolean)), [ blockQuery, blockTxsQuery, blockWithdrawalsQuery ]);
Expand Down

0 comments on commit 3230e44

Please sign in to comment.