Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

abort setState when our component unmount #145

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

henrypalacios
Copy link
Contributor

Summary

Closes #138

Avoid Race condition when send request with currentNetwork
Selection_588

Using AbortController web request.

@github-actions
Copy link


const executedSellAmount = order?.executedSellAmount.toString()
const executedBuyAmount = order?.executedBuyAmount.toString()
useEffect(() => {
if (!networkId || !order?.uid) {
return
}
const controller = new AbortController()
Copy link
Contributor Author

@henrypalacios henrypalacios Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramirotw we could use a simple boolean (canceled = false) variable here as well, but AbortController seems more appropriate.

@matextrem
Copy link
Contributor

Good catch 👍

@ramirotw ramirotw merged commit b4fa344 into ramirotw/issue-130-search-orderid Jun 24, 2022
@ramirotw ramirotw deleted the 138-no-tx-hash branch June 24, 2022 23:44
ramirotw added a commit that referenced this pull request Jun 29, 2022
* bump cow-sdk

* fix missing prod/barn responses merge

* abort setState when our component unmount (#145)

* re-run tokens fetch if network changes while there's an in-flight request

* disable env merge for getAccountOrders

* fix order search in different networks

Co-authored-by: Henry Palacios <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
app:Explorer Explorer App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants