pancake-frontend
pancake-frontend copied to clipboard
fix: Back button not working after url changed by swap or query added
PR-Codex overview
This PR focuses on refactoring the replaceBrowserHistory
functionality to use replaceBrowserHistoryMultiple
, allowing for multiple URL parameter updates in a single call. This enhances code readability and performance by consolidating history state updates.
Detailed summary
- Introduced
replaceBrowserHistoryMultiple
inreplaceBrowserHistoryMultiple.ts
. - Updated
replaceBrowserHistory
to handle undefined or null values usingisUndefinedOrNull
. - Replaced instances of
replaceBrowserHistory
withreplaceBrowserHistoryMultiple
across multiple components. - Enhanced URL state management in various files, including
FlipButton.tsx
,FormMain.tsx
, andTwap.tsx
, to handle multiple parameters efficiently.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}