Skip to content

Commit

Permalink
fix: disable ActionButton whilst awaiting wallet action (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzmp authored Dec 10, 2022
1 parent c0740fb commit 6532f84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/Swap/SwapActionButton/SwitchChainButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ export default function ChainSwitchButton({ color, chainId }: { color: keyof Col
: {
message: <Trans>Switch network</Trans>,
onClick: onSwitchChain,
children: <Trans>Switch</Trans>,
},
[account, isPending, onSwitchChain]
)

return <ActionButton color={color} action={actionProps} />
return (
<ActionButton color={color} disabled={isPending} action={actionProps}>
<Trans>Switch</Trans>
</ActionButton>
)
}
2 changes: 1 addition & 1 deletion src/components/Swap/SwapActionButton/WrapButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function WrapButton({
)

return (
<ActionButton color={color} {...actionProps} disabled={disabled}>
<ActionButton color={color} {...actionProps} disabled={disabled || isPending}>
<Trans>
{wrapType === TransactionType.WRAP ? 'Wrap' : 'Unwrap'} {inputCurrency?.symbol}
</Trans>
Expand Down

1 comment on commit 6532f84

@vercel
Copy link

@vercel vercel bot commented on 6532f84 Dec 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

widgets – ./

widgets-git-main-uniswap.vercel.app
widgets-seven-tau.vercel.app
widgets-uniswap.vercel.app

Please sign in to comment.