From 15dae69ee572fc6ce72b8b671bc8737bbadde860 Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Thu, 8 Dec 2022 11:39:54 -0800 Subject: [PATCH] chain dropdown --- .../bridge-ui/src/components/ChainDropdown.svelte | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/bridge-ui/src/components/ChainDropdown.svelte b/packages/bridge-ui/src/components/ChainDropdown.svelte index 7bf0edf1a42..73667a67a6f 100644 --- a/packages/bridge-ui/src/components/ChainDropdown.svelte +++ b/packages/bridge-ui/src/components/ChainDropdown.svelte @@ -2,7 +2,7 @@ import { _ } from "svelte-i18n"; import ChevDown from "./icons/ChevDown.svelte"; - import { fromChain } from "../store/chain"; + import { fromChain, toChain } from "../store/chain"; import MetaMask from "./icons/MetaMask.svelte"; import { switchEthereumChain } from "../utils/switchEthereumChain"; import { ethereum } from "../store/ethereum"; @@ -15,6 +15,12 @@ const provider = new ethers.providers.Web3Provider(window.ethereum); await provider.send("eth_requestAccounts", []); + fromChain.set(chain); + if (chain === CHAIN_MAINNET) { + toChain.set(CHAIN_TKO); + } else { + toChain.set(CHAIN_MAINNET); + } signer.set(provider.getSigner()); }; @@ -45,7 +51,7 @@ > {CHAIN_MAINNET.name} - +
  • @@ -57,7 +63,7 @@ > {CHAIN_TKO.name} - +