pancake-frontend
pancake-frontend copied to clipboard
fix: Remove dismiss from wrong network to avoid sending trx to wrong network
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
forhideWrongNetworkModalAtom
. - Simplified the
CommitButton
component's click handling logic. - Removed
onDismiss
prop fromWrongNetworkModal
. - 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}