Skip to content

Commit

Permalink
fix(bridge-ui): inform connect when adding erc20 (#13900)
Browse files Browse the repository at this point in the history
Co-authored-by: jeff <[email protected]>
  • Loading branch information
jscriptcoder and cyberhorsey authored Jun 6, 2023
1 parent 1abc3ff commit 2b21f59
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/bridge-ui/src/components/BridgeForm/SelectToken.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import { tokens } from '../../token/tokens';
import { selectTokenAndBridgeType } from '../../utils/selectTokenAndBridgeType';
import Erc20 from '../icons/ERC20.svelte';
import { errorToast, successToast } from '../NotificationToast.svelte';
import {
errorToast,
successToast,
warningToast,
} from '../NotificationToast.svelte';
import AddCustomErc20 from './AddCustomERC20.svelte';
let dropdownElement: HTMLDivElement;
Expand All @@ -33,6 +37,15 @@
closeDropdown();
}
function showAddERC20() {
if (!$signer) {
warningToast('Please, connect your wallet.');
return;
}
showAddressField = true;
}
async function addERC20(event: SubmitEvent) {
loading = true;
Expand Down Expand Up @@ -140,7 +153,7 @@

<li>
<button
on:click={() => (showAddressField = true)}
on:click={showAddERC20}
class="flex hover:bg-dark-5 justify-between items-center p-4 rounded-sm">
<PlusCircle size="25" />
<span
Expand Down

0 comments on commit 2b21f59

Please sign in to comment.