pancake-frontend icon indicating copy to clipboard operation
pancake-frontend copied to clipboard

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

Open memoyil opened this issue 3 months ago • 2 comments

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

  • Updated EXCHANGE_PAGE_PATHS to use an array format.
  • Removed the use of useSetAtom for hideWrongNetworkModalAtom.
  • Simplified the CommitButton component's click handling logic.
  • Removed onDismiss prop from WrongNetworkModal.
  • Modified NetworkModal to eliminate unnecessary state management.
  • Removed dismiss handling for the wrong network modal in NetworkModal.

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

memoyil avatar Oct 30 '24 18:10 memoyil