Skip to content

Commit

Permalink
fix: Pool boosted UI (#8422)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->

<!--
copilot:all
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at 1546279</samp>

### Summary
🔄🔗🚀

<!--
1. 🔄 - This emoji represents the refetching of the query when the
network changes, as well as the possible variation of the APR values.
2. 🔗 - This emoji represents the chainId parameter, which identifies the
network that the user is connected to, and the query key, which is
composed of the chainId and other arguments.
3. 🚀 - This emoji represents the boosted pools, which offer higher
rewards and incentives for liquidity providers.
-->
Added `chainId` to query key for fetching boosted pool APRs. This allows
the query to update the APRs based on the network the user is connected
to.

> _`useQuery` changes_
> _`chainId` affects the APR_
> _Pools shift with seasons_

### Walkthrough
* Add `chainId` parameter to query key of `useQuery` hook to refetch
boosted pool APR when network changes
([link](https://github.com/pancakeswap/pancake-frontend/pull/8422/files?diff=unified&w=0#diff-fecd21c45f9d393643358542fcc35dc2f73d5edd2055bc61ee67c7e84aaff089L15-R15))
  • Loading branch information
ChefMomota authored Nov 23, 2023
1 parent f8caf2b commit 6cb13a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/web/src/views/Pools/hooks/useBoostedPoolApr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useBoostedPoolApr = ({ contractAddress, chainId }: UseBoostedPoolAp
const client = getViemClients({ chainId })

const { data } = useQuery(
['boostedPoolsApr'],
['boostedPoolsApr', contractAddress, chainId],
() => {
if (client) {
return getBoostedPoolApr({
Expand Down

1 comment on commit 6cb13a8

@vercel
Copy link

@vercel vercel bot commented on 6cb13a8 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.