Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed multi pending list problem #311

Merged

Conversation

SpectreMercury
Copy link
Collaborator

checkL2PendingTimer.current = setInterval(() => {
  loadPendingHistory(localTxHistory);
}, 15000);

In this problem, the most likely reason is that React's closure behavior is causing the localTxHistory to remain unchanged within the setInterval function. When setInterval is created by useDeepCompareEffect, it saves the value of localTxHistory at that moment, and this value is not updated in subsequent setInterval calls.

One way to solve this problem is to use useRef to maintain a reference to localTxHistory. This way, every time setInterval is executed, we always get the latest value of localTxHistory.

@vercel
Copy link

vercel bot commented May 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
godwoken-bridge-mainnet ✅ Ready (Inspect) Visit Preview May 26, 2023 4:07am
godwoken-bridge-testnet ✅ Ready (Inspect) Visit Preview May 26, 2023 4:07am

@Flouse Flouse merged commit c3d368e into godwokenrises:develop May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants