Skip to content

Commit

Permalink
fix: inf loop
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlilley committed Aug 1, 2024
1 parent e0b55a2 commit 0c67879
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/ui/swap/simple/simple-swap-trade-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const _SimpleSwapTradeButton: FC<{
if (warningSeverity(trade?.priceImpact) <= 3) {
setChecked(false)
}
}, [trade])
}, [trade?.priceImpact])

return (
<>
Expand Down
2 changes: 0 additions & 2 deletions packages/react-query/src/hooks/trade/useTrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export const useTradeQuery = (
},
refetchOnWindowFocus: true,
refetchInterval: 2500,
placeholderData: (prevData) => (amount ? prevData : undefined),
gcTime: 0, // the length of time before inactive data gets removed from the cache
retry: false, // dont retry on failure, immediately fallback
select,
Expand Down Expand Up @@ -146,7 +145,6 @@ export const useTrade = (variables: UseTradeParams) => {

const select: UseTradeQuerySelect = useCallback(
(data) => {
// console.log('data.args', data?.args)
if (data && amount && data.route && fromToken && toToken) {
const amountIn = Amount.fromRawAmount(fromToken, data.route.amountInBI)
const amountOut = Amount.fromRawAmount(
Expand Down

0 comments on commit 0c67879

Please sign in to comment.