1
1
/* eslint-disable sonarjs/cognitive-complexity */
2
2
import React , { useCallback , useEffect , useMemo , useState } from 'react' ;
3
3
import isNil from 'lodash/isNil' ;
4
+ import { Wallet } from '@lace/cardano' ;
4
5
import { AssetTableProps } from '@lace/core' ;
5
6
import { useObservable } from '@lace/common' ;
6
7
import { useBalances , useFetchCoinPrice , useRedirection } from '@hooks' ;
@@ -12,7 +13,7 @@ import { DrawerContent } from '@src/views/browser-view/components/Drawer';
12
13
import { walletRoutePaths } from '@routes' ;
13
14
import { APP_MODE_POPUP } from '@src/utils/constants' ;
14
15
import { ContentLayout } from '@components/Layout' ;
15
- import { useAnalyticsContext , useAppSettingsContext } from '@providers' ;
16
+ import { useAnalyticsContext } from '@providers' ;
16
17
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker' ;
17
18
import { isNFT } from '@src/utils/is-nft' ;
18
19
import {
@@ -56,15 +57,15 @@ export const Assets = ({ topSection }: AssetsProps): React.ReactElement => {
56
57
activityDetail,
57
58
resetActivityState,
58
59
blockchainProvider,
59
- environmentName
60
+ environmentName,
61
+ currentChain
60
62
} = useWalletStore ( ) ;
61
63
const popupView = appMode === APP_MODE_POPUP ;
62
64
const hiddenBalancePlaceholder = getHiddenBalancePlaceholder ( ) ;
63
65
const { setPickedCoin } = useCoinStateSelector ( SEND_COIN_OUTPUT_ID ) ;
64
66
const { setTriggerPoint } = useAnalyticsSendFlowTriggerPoint ( ) ;
65
67
const isScreenTooSmallForSidePanel = useIsSmallerScreenWidthThan ( BREAKPOINT_SMALL ) ;
66
- const [ { chainName } ] = useAppSettingsContext ( ) ;
67
- const isMainnet = chainName === 'Mainnet' ;
68
+ const isMainnet = currentChain ?. networkMagic === Wallet . Cardano . NetworkMagics . Mainnet ;
68
69
69
70
const [ isActivityDetailsOpen , setIsActivityDetailsOpen ] = useState ( false ) ;
70
71
const [ fullAssetList , setFullAssetList ] = useState < AssetTableProps [ 'rows' ] > ( ) ;
0 commit comments