Skip to content

Commit

Permalink
Fix not returning Connect Wallet Button if no sourceAccount found (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao authored Sep 26, 2024
1 parent b114667 commit 643ea4c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions packages/widget-v2/src/pages/SwapPage/SwapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,19 @@ export const SwapPage = () => {
if (isRouteError) {
return <MainButton label={routeError.message} disabled />;
}

if (!sourceAccount?.address) {
<MainButton
disabled={!sourceAsset?.chainID}
label="Connect Wallet"
icon={ICONS.plus}
onClick={() => {
selectWalletmodal.show({
chainId: sourceAsset?.chainID,
});
}}
/>;
return (
<MainButton
disabled={!sourceAsset?.chainID}
label="Connect Wallet"
icon={ICONS.plus}
onClick={() => {
selectWalletmodal.show({
chainId: sourceAsset?.chainID,
});
}}
/>
);
}
if (insufficientBalance) {
return (
Expand Down

0 comments on commit 643ea4c

Please sign in to comment.