Skip to content

Commit

Permalink
fix: missing chain query (#10891)
Browse files Browse the repository at this point in the history
<!-- start pr-codex -->

## PR-Codex overview
This PR modifies the `addQueryToPath.ts` utility function to handle
query parameters more effectively by ensuring that when the `key` is
`'chain'`, the `chainId` is deleted from `searchParams`.

### Detailed summary
- Removed the conditional block that deletes `chainId` when `key` is
`'chain'`.
- Ensured `searchParams.set(key, queryParams[key])` is always executed
regardless of the `key`.
- The return statement constructs the URL with updated `searchParams`.

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

<!-- end pr-codex -->
  • Loading branch information
chef-eric authored Oct 30, 2024
1 parent abf868f commit 6368c7c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/web/src/utils/addQueryToPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export function addQueryToPath(path: string, queryParams: { [key: string]: strin
Object.keys(queryParams).forEach((key) => {
if (key === 'chain') {
searchParams.delete('chainId')
} else {
searchParams.set(key, queryParams[key])
}
searchParams.set(key, queryParams[key])
})

return `${pathname}?${searchParams.toString()}`
Expand Down

0 comments on commit 6368c7c

Please sign in to comment.