-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CL add liq: remove legacy pool query & fix CL add liq intro data #3878
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
WalkthroughThe changes in this pull request involve the removal of files and code related to pool fee metrics management. Specifically, the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (1)
packages/web/components/complex/add-conc-liquidity.tsx (1)
Line range hint
574-590
: Ensure 'pool.reserveCoins' has the expected structureWhen accessing
pool.reserveCoins
at indices[0]
and[1]
, there's an assumption that the array contains at least two elements. Ifpool
orreserveCoins
is undefined or has fewer elements, this could lead to runtime errors. Consider adding checks to ensurepool.reserveCoins
has the expected length.Apply this diff to add safety checks:
- <DepositAmountGroup - currency={pool?.reserveCoins[0]?.currency} + {pool?.reserveCoins?.[0]?.currency && ( + <DepositAmountGroup + currency={pool.reserveCoins[0].currency} ... + /> + )} ... - <DepositAmountGroup - currency={pool?.reserveCoins[1]?.currency} + {pool?.reserveCoins?.[1]?.currency && ( + <DepositAmountGroup + currency={pool.reserveCoins[1].currency} ... + /> + )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- packages/stores/src/queries-external/pool-fees/index.ts (0 hunks)
- packages/stores/src/queries-external/pool-fees/types.ts (0 hunks)
- packages/stores/src/queries-external/store.ts (0 hunks)
- packages/web/components/complex/add-conc-liquidity.tsx (10 hunks)
💤 Files with no reviewable changes (3)
- packages/stores/src/queries-external/pool-fees/index.ts
- packages/stores/src/queries-external/pool-fees/types.ts
- packages/stores/src/queries-external/store.ts
🧰 Additional context used
|
||
import { Tooltip } from "../tooltip"; | ||
|
||
// TODO: don't think these dynamic imports are needed or are set up properly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the TODO comment regarding dynamic imports
There is a TODO comment indicating that the dynamic imports may not be needed or are not set up properly. It's important to resolve or remove TODO comments before merging to maintain code quality and avoid potential issues.
If these dynamic imports are unnecessary, consider removing them to optimize performance. If they are required, ensure they are correctly configured.
const { queriesExternalStore } = useStore(); | ||
|
||
const { queryQuasarVaults } = queriesExternalStore; | ||
const { vaults: quasarVaults } = queryQuasarVaults.get(poolId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider refactoring 'quasarVaults' data fetching to use API queries
Since you've updated the pool data fetching to use API queries, consider migrating the quasarVaults
data fetching to use the same approach. This would reduce dependencies on the MobX store and streamline your data retrieval process.
Would you like assistance in updating quasarVaults
fetching to use the API?
const { data: pool } = api.edge.pools.getPool.useQuery({ | ||
poolId, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle loading and error states when fetching pool data
Currently, you're extracting data
as pool
without handling the loading or error states from useQuery
. This might lead to unintended behaviors if the data is still loading or if there's an error fetching the pool data. Consider handling isLoading
and error
states to enhance user experience and prevent potential runtime errors.
Apply this diff to handle loading and error states:
const {
data: pool,
+ isLoading,
+ error,
} = api.edge.pools.getPool.useQuery({
poolId,
});
+
+ if (isLoading) {
+ return <Spinner />;
+ }
+
+ if (error) {
+ return <div>Error loading pool data</div>;
+ }
Committable suggestion was skipped due to low confidence.
What is the purpose of the change:
Closes: FE-1145
Remove legacy mobx pool query and replace with tRPC get pool utilities. Fixes display of some pool data when starting CL add liq flow:
Now:
Prod: