From 87beaa6fce9de427a0c6db8a536162d4f9ccf152 Mon Sep 17 00:00:00 2001 From: Gonzalo D'elia Date: Thu, 16 Jan 2025 17:22:00 -0300 Subject: [PATCH] Disable bitcoin for mainnet --- webapp/hooks/useNetworks.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/webapp/hooks/useNetworks.ts b/webapp/hooks/useNetworks.ts index 551e4935..dc0522a8 100644 --- a/webapp/hooks/useNetworks.ts +++ b/webapp/hooks/useNetworks.ts @@ -27,17 +27,24 @@ export const useNetworks = function () { // All enabled networks const networks: RemoteChain[] = useMemo( - // @ts-expect-error .concat() automatically casts the result type to evmNetworks' type. - () => evmNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []), - [bitcoin, evmNetworks], + // TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738 + () => + evmNetworks.concat( + // @ts-expect-error .concat() automatically casts the result type to evmNetworks' type. + featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [], + ), + [bitcoin, evmNetworks, type], ) // All enabled networks that can tunnel to/from Hemi const remoteNetworks: RemoteChain[] = useMemo( + // TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738 () => - // @ts-expect-error .concat() automatically casts the result type to evmNetworks' type. - evmRemoteNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []), - [bitcoin, evmRemoteNetworks], + evmRemoteNetworks.concat( + // @ts-expect-error .concat() automatically casts the result type to evmNetworks' type. + featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [], + ), + [bitcoin, evmRemoteNetworks, type], ) return {