Skip to content

Commit

Permalink
Tighten up alternative bridge quotes fetching conditions for stability
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Oct 6, 2023
1 parent 2a9ed4e commit 5c3ecc7
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions packages/synapse-interface/slices/bridge/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Updater(): null {
}: BridgeState = useBridgeState()

/**
* Debounce user input to fetch primary bridge quote
* Debounce user input to fetch primary bridge quote (in ms)
* Delay loading animation when user input updates
*/
useEffect(() => {
Expand Down Expand Up @@ -90,25 +90,21 @@ export default function Updater(): null {
}
)

dispatch(
fetchAndStoreBridgeQuotes({
requests: bridgeQuoteRequests,
synapseSDK,
})
)
if (hasFromValue) {
console.log('fetching')
dispatch(
fetchAndStoreBridgeQuotes({
requests: bridgeQuoteRequests,
synapseSDK,
})
)
}
}

if (!fromToken) {
dispatch(resetFetchedBridgeQuotes())
}
}, [
// fromChainId,
// toChainId,
// fromToken,
// synapseSDK,
debouncedToTokensFromValue,
toTokens,
])
}, [debouncedToTokensFromValue, toTokens])

return null
}
Expand Down

0 comments on commit 5c3ecc7

Please sign in to comment.