From 81430caea1e8f45fb815a2db48c1eee291ca6af3 Mon Sep 17 00:00:00 2001 From: Edgar Khanzadian Date: Thu, 14 Dec 2023 19:08:07 +0400 Subject: [PATCH] fix: check with stacks testnet instead of bitcoin testnet --- src/app/pages/home/components/account-actions.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/pages/home/components/account-actions.tsx b/src/app/pages/home/components/account-actions.tsx index 13fe8e2636c..772ede5f61f 100644 --- a/src/app/pages/home/components/account-actions.tsx +++ b/src/app/pages/home/components/account-actions.tsx @@ -1,12 +1,12 @@ import { useLocation, useNavigate } from 'react-router-dom'; +import { ChainID } from '@stacks/transactions'; import { HomePageSelectors } from '@tests/selectors/home.selectors'; import { Flex, FlexProps } from 'leather-styles/jsx'; -import { bitcoinNetworkModeToCoreNetworkMode } from '@shared/crypto/bitcoin/bitcoin.utils'; import { RouteUrls } from '@shared/route-urls'; -import { whenNetwork } from '@shared/utils'; +import { whenStacksChainId } from '@app/common/utils'; import { useConfigBitcoinEnabled } from '@app/query/common/remote-config/remote-config.query'; import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks'; import { useCurrentNetwork } from '@app/store/networks/networks.selectors'; @@ -23,9 +23,6 @@ export function AccountActions(props: FlexProps) { const isBitcoinEnabled = useConfigBitcoinEnabled(); const stacksAccount = useCurrentStacksAccount(); const currentNetwork = useCurrentNetwork(); - const networkType = bitcoinNetworkModeToCoreNetworkMode( - currentNetwork.chain.bitcoin.bitcoinNetwork - ); const receivePath = isBitcoinEnabled ? RouteUrls.Receive @@ -49,8 +46,8 @@ export function AccountActions(props: FlexProps) { onClick={() => navigate(RouteUrls.FundChooseCurrency)} /> )} - {whenNetwork(networkType)({ - mainnet: ( + {whenStacksChainId(currentNetwork.chain.stacks.chainId)({ + [ChainID.Mainnet]: ( } @@ -58,7 +55,7 @@ export function AccountActions(props: FlexProps) { onClick={() => navigate(RouteUrls.Swap)} /> ), - testnet: null, + [ChainID.Testnet]: null, })} );