Skip to content

Commit

Permalink
btn for bridgeform doesnt work if doesnt map to a testnet chain (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey authored Dec 19, 2022
1 parent fb801f2 commit e4193d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/bridge-ui/src/components/form/BridgeForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit e4193d2

Please sign in to comment.