Skip to content

Commit

Permalink
fix: guard for unnecessary gas estimation
Browse files Browse the repository at this point in the history
  • Loading branch information
ogous committed Sep 30, 2024
1 parent 33dd034 commit 0d5ab6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/components/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const SwapForm = () => {
// TODO this is in ETH(/SPN), not USD
useEffect(() => {
(async () => {
if (!client || !address) return;
if (!client || !address || BigInt(token0AmountRaw ?? 0) === 0n) return;
try {
const estimatedGas = await estimateContractGas(client, {
...swapOptions,
Expand Down

0 comments on commit 0d5ab6a

Please sign in to comment.