Skip to content

Commit 683238e

Browse files
committed
fix: swap approve button
1 parent 40fa006 commit 683238e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/smart-trade-button/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export function SmartTradeButton(props: SmartTradeButtonProps) {
130130

131131
if (buttonState === TradeButtonState.insufficientFunds) return
132132

133+
console.log({ isApprovedForSwap, shouldApprove })
133134
if (!isApprovedForSwap && shouldApprove) {
134135
await onApproveForSwap()
135136
return

src/lib/hooks/use-approval.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const useApproval = (
4545
}, [amount, data, isApproving, token])
4646

4747
const approve = useCallback(async () => {
48+
console.log('inside approve')
4849
if (!publicClient || !walletClient) return false
4950
setIsApproving(true)
5051
try {
@@ -61,7 +62,8 @@ export const useApproval = (
6162
await refetch()
6263
setIsApproving(false)
6364
return true
64-
} catch {
65+
} catch (e) {
66+
console.log('caught approve errror', e)
6567
setIsApproving(false)
6668
return false
6769
}

0 commit comments

Comments
 (0)