Skip to content

Commit

Permalink
fix: Chain param in query after switching network to bsc (#10715)
Browse files Browse the repository at this point in the history
![image](https://github.com/user-attachments/assets/ad9addc7-6776-4808-ad2e-943adc4bf833)

<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `useSwitchNetwork` hook and `WrongNetworkModal`
component to remove conditional setting of the `chain` query parameter
based on `chainId`.

### Detailed summary
- Removed conditional setting of `chain` query parameter based on
`chainId` in `useSwitchNetwork` hook.
- Removed conditional setting of `chain` query parameter based on
`chainId` in `WrongNetworkModal` component.

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

<!-- end pr-codex -->
  • Loading branch information
memoyil authored Sep 21, 2024
1 parent 06331a0 commit e1587a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/components/NetworkModal/WrongNetworkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function WrongNetworkModal({ currentChain, onDismiss }: { currentChain: C
pathname: router.pathname,
query: {
...router.query,
chain: chainId === ChainId.BSC ? null : CHAIN_QUERY_NAME[chainId],
chain: CHAIN_QUERY_NAME[chainId],
},
},
undefined,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/hooks/useSwitchNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function useSwitchNetworkLocal() {
pathname: router.pathname,
query: {
...router.query,
chain: chainId === ChainId.BSC ? null : CHAIN_QUERY_NAME[chainId],
chain: CHAIN_QUERY_NAME[chainId],
},
},
undefined,
Expand Down

0 comments on commit e1587a2

Please sign in to comment.