Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge-ui): NETWORK_ERROR exception #13562

Merged
merged 2 commits into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions packages/bridge-ui/src/components/form/SelectChain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import { errorToast, successToast } from '../Toast.svelte';

const toggleChains = async () => {
if (!$signer) {
errorToast('Please connect your wallet');
return;
}

try {
const chain = $fromChain === mainnetChain ? taikoChain : mainnetChain;
await switchNetwork({
Expand Down Expand Up @@ -43,10 +48,10 @@
{/if}
</div>

<button
on:click={toggleChains}
class="btn btn-square btn-sm toggle-chain"
disabled={!$signer}><ArrowRight size="16" /></button>
<button on:click={toggleChains} class="btn btn-square btn-sm toggle-chain">
<ArrowRight size="16" />
</button>

<div class="flex items-center w-2/5 justify-center">
{#if $toChain}
<svelte:component this={$toChain.icon} />
Expand Down