Skip to content

Commit df7d00b

Browse files
authored
fix(extension): [LW-11508] only display banxa popup on mainnet (#1427)
1 parent e6b5ae1 commit df7d00b

File tree

1 file changed

+5
-4
lines changed
  • apps/browser-extension-wallet/src/views/browser-view/features/assets/components

1 file changed

+5
-4
lines changed

apps/browser-extension-wallet/src/views/browser-view/features/assets/components/Assets.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable sonarjs/cognitive-complexity */
22
import React, { useCallback, useEffect, useMemo, useState } from 'react';
33
import isNil from 'lodash/isNil';
4+
import { Wallet } from '@lace/cardano';
45
import { AssetTableProps } from '@lace/core';
56
import { useObservable } from '@lace/common';
67
import { useBalances, useFetchCoinPrice, useRedirection } from '@hooks';
@@ -12,7 +13,7 @@ import { DrawerContent } from '@src/views/browser-view/components/Drawer';
1213
import { walletRoutePaths } from '@routes';
1314
import { APP_MODE_POPUP } from '@src/utils/constants';
1415
import { ContentLayout } from '@components/Layout';
15-
import { useAnalyticsContext, useAppSettingsContext } from '@providers';
16+
import { useAnalyticsContext } from '@providers';
1617
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker';
1718
import { isNFT } from '@src/utils/is-nft';
1819
import {
@@ -56,15 +57,15 @@ export const Assets = ({ topSection }: AssetsProps): React.ReactElement => {
5657
activityDetail,
5758
resetActivityState,
5859
blockchainProvider,
59-
environmentName
60+
environmentName,
61+
currentChain
6062
} = useWalletStore();
6163
const popupView = appMode === APP_MODE_POPUP;
6264
const hiddenBalancePlaceholder = getHiddenBalancePlaceholder();
6365
const { setPickedCoin } = useCoinStateSelector(SEND_COIN_OUTPUT_ID);
6466
const { setTriggerPoint } = useAnalyticsSendFlowTriggerPoint();
6567
const isScreenTooSmallForSidePanel = useIsSmallerScreenWidthThan(BREAKPOINT_SMALL);
66-
const [{ chainName }] = useAppSettingsContext();
67-
const isMainnet = chainName === 'Mainnet';
68+
const isMainnet = currentChain?.networkMagic === Wallet.Cardano.NetworkMagics.Mainnet;
6869

6970
const [isActivityDetailsOpen, setIsActivityDetailsOpen] = useState(false);
7071
const [fullAssetList, setFullAssetList] = useState<AssetTableProps['rows']>();

0 commit comments

Comments
 (0)