Skip to content

Commit 5fd025f

Browse files
committed
fix: add network validation
1 parent 13ca4b4 commit 5fd025f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/features/add-network/use-add-network.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
bitcoinNetworkToNetworkMode,
1111
networkConfigurationSchema,
1212
} from '@leather.io/models';
13+
import { isDefined } from '@leather.io/utils';
1314

1415
import { RouteUrls } from '@shared/route-urls';
1516
import { isValidUrl } from '@shared/utils/validate-url';
@@ -175,7 +176,7 @@ export function useAddNetwork() {
175176
bitcoinUrl: bitcoinPath,
176177
});
177178
navigate(RouteUrls.Home);
178-
} else if (chainId === ChainID.Mainnet || chainId === ChainID.Testnet) {
179+
} else if (isDefined(chainId)) {
179180
removeEditedNetwork();
180181
networksActions.addNetwork({
181182
id: key as DefaultNetworkConfigurations,

0 commit comments

Comments
 (0)