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

fix: Is wrong network modal persists when going back #11108

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

memoyil
Copy link
Collaborator

@memoyil memoyil commented Jan 3, 2025

To reproduce:

Go to liqudity positions
Go to details of a position with different chain
See wrong network modal
Without switching chain go back, and see modal still displayed


PR-Codex overview

This PR updates the useLocalNetworkChain function in the useActiveChainId.ts file to improve the handling of the chainId based on the readiness of the router. It ensures that the setQueryChainId is only called when necessary.

Detailed summary

  • Added isReady from useRouter() to check if the router is ready.
  • Modified the logic to set chainId only if isReady is true.
  • Added a check to update queryChainId only if it differs from chainId.
  • Adjusted the dependencies of the useEffect hook to include isReady and queryChainId.
  • Updated the condition for isChainSupported to ensure chainId is defined before checking support.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jan 3, 2025

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

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 10:36am
7 Skipped Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
blog ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
bridge ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
games ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
gamification ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
uikit ⬜️ Ignored (Inspect) Jan 3, 2025 10:36am
ton ⬜️ Skipped (Inspect) Jan 3, 2025 10:36am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant