Skip to content

Commit

Permalink
fix: simplify swap disabled state (Uniswap#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzmp authored Jan 11, 2023
1 parent cc31c7e commit 23928cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/components/Swap/SwapActionButton/SwapButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ export default function SwapButton({ disabled }: { disabled: boolean }) {

return (
<>
<ActionButton
color={color}
onClick={onClick}
disabled={disabled || (permit2Enabled && allowance.state === AllowanceState.LOADING)}
>
<ActionButton color={color} onClick={onClick} disabled={disabled}>
<Trans>Review swap</Trans>
</ActionButton>
{open && trade && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Swap/SwapActionButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function SwapActionButton() {
const permit2Enabled = usePermit2Enabled()
const isDisabled = useMemo(
() =>
(permit2Enabled && allowance.state === AllowanceState.REQUIRED) ||
(permit2Enabled && allowance.state !== AllowanceState.ALLOWED) ||
(!permit2Enabled && approval.state !== SwapApprovalState.APPROVED) ||
error !== undefined ||
(!isWrap && !trade) ||
Expand Down

0 comments on commit 23928cc

Please sign in to comment.