-
Notifications
You must be signed in to change notification settings - Fork 425
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
(Hotfix) Avoid computing overspend if 1CT session is disabled #3982
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
4 Skipped Deployments
|
WalkthroughThe pull request introduces modifications to the one-click trading functionality within the Changes
Possibly related PRs
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.tsOops! Something went wrong! :( ESLint: 8.50.0 ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct. The config "next/core-web-vitals" was referenced from the config file in "/packages/web/.eslintrc.json". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Learnings (1)packages/web/modals/review-order.tsx (1)
🔇 Additional comments (3)packages/web/hooks/one-click-trading/use-one-click-trading-swap-review.ts (1)Line range hint The modification to
This aligns with the PR objective of avoiding unnecessary overspend computations when 1CT is disabled. packages/web/modals/review-order.tsx (2)
The changes to
This ensures the UI behaves consistently with the core logic changes. Line range hint Let's verify that the disabled state check is consistently implemented across all related code. ✅ Verification successfulBased on the search results, I can now generate the final response as I have sufficient information to verify the implementation consistency. Implementation is consistent across the codebase The disabled state check is properly implemented:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any other instances where overspend is calculated without checking the enabled state.
# Search for functions that might calculate overspend
ast-grep --pattern 'function $name($params) {
$$$
wouldSpend$$$
$$$
}'
# Search for usages of wouldExceedSpendLimit without enabled check
rg -A 5 'wouldExceedSpendLimit'
Length of output: 5816 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 (
|
No description provided.