From e4193d2e653507b7ca3d3ee7fe5928035b88f882 Mon Sep 17 00:00:00 2001 From: jeff <113397187+cyberhorsey@users.noreply.github.com> Date: Sun, 18 Dec 2022 20:46:21 -0800 Subject: [PATCH] btn for bridgeform doesnt work if doesnt map to a testnet chain (#456) --- packages/bridge-ui/src/components/form/BridgeForm.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/bridge-ui/src/components/form/BridgeForm.svelte b/packages/bridge-ui/src/components/form/BridgeForm.svelte index dd128734f62..f80cafd2e0c 100644 --- a/packages/bridge-ui/src/components/form/BridgeForm.svelte +++ b/packages/bridge-ui/src/components/form/BridgeForm.svelte @@ -18,6 +18,8 @@ import type { Token } from "../../domain/token"; import type { BridgeType } from "../../domain/bridge"; + import { chains } from "../../domain/chain"; + import type { Chain } from "../../domain/chain"; import { truncateString } from "../../utils/truncateString"; import { @@ -120,6 +122,8 @@ requiresAllowance: boolean ) { if (!signer) return true; + const chainId = await signer.getChainId(); + if (!chainId || !chains[chainId.toString()]) return true; if (!amount) return true; if (isNaN(parseFloat(amount))) return true; if (