pancakeswap / pancake-frontend

:pancakes: Pancake main features (farms, pools, IFO, lottery, profiles)
https://pancakeswap.finance
GNU General Public License v3.0
2.7k stars 3.55k forks source link

fix: Remove dismiss from wrong network to avoid sending trx to wrong network #10897

Open memoyil opened 3 weeks ago

memoyil commented 3 weeks ago

To reproduce:

Find a lp position on different chain

Dismiss the wrong network modal

Collect/Add/Remove button available and make transaction when click

(Can happen on other pages too)


PR-Codex overview

This PR primarily focuses on refactoring the code related to network handling in a web application. It simplifies the state management and modifies the way the WrongNetworkModal component is used.

Detailed summary

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

vercel[bot] commented 3 weeks ago

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 Oct 30, 2024 6:47pm
6 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **aptos-web** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/aptos-web/6XEuaLhbqYBRQoH9EZFD9XsGsjYv)) | | | Oct 30, 2024 6:47pm | | **blog** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/blog/8Xqz2xrwGRqBzfHukZUmLfYZWvTL)) | [Visit Preview](https://blog-git-feature-fixremovedismissfromwrongnetwork.pancake.run) | | Oct 30, 2024 6:47pm | | **bridge** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/bridge/7QJd5xd6psXKCyBjHNYyNTBcA3jN)) | [Visit Preview](https://bridge-git-feature-fixremovedismissfromwrongnetwork.pancake.run) | | Oct 30, 2024 6:47pm | | **games** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/games/2oEyEKmb3bWRwKEcTW79PVmCjmLV)) | [Visit Preview](https://games-git-feature-fixremovedismissfromwrongnetwork.pancake.run) | | Oct 30, 2024 6:47pm | | **gamification** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/gamification/HQDKNKYsG3k1a5N5yUZPzAC6QMpz)) | [Visit Preview](https://gamification-git-feature-fixremovedismissfromwrongnetwork.pancake.run) | | Oct 30, 2024 6:47pm | | **uikit** | ⬜️ Ignored ([Inspect](https://vercel.com/pancakeswap/uikit/4eVTjGZKxZSNr58zmwme9MDPKDMD)) | [Visit Preview](https://uikit-git-feature-fixremovedismissfromwrongnetwork.pancake.run) | | Oct 30, 2024 6:47pm |
changeset-bot[bot] commented 3 weeks ago

⚠️ No Changeset found

Latest commit: 77b132a8325f09cfc54834f07220583063b33caf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR