-
Notifications
You must be signed in to change notification settings - Fork 198
fix: set send asset only if scheme url is detected from qr code #11794
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
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe change modifies QR code scanning logic in the Send form to restrict asset and account ID updates to payment URIs only, preventing plain scanned addresses from overriding the user's previously selected asset. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
55c658f to
4b92ce6
Compare
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: 1
🤖 Fix all issues with AI agents
In `@src/components/Modals/Send/Form.tsx`:
- Around line 313-315: Remove the two newly added inline comment lines
immediately above the if statement that reads "if (urlDirectResult &&
maybeUrlResult.assetId)" in src/components/Modals/Send/Form.tsx; leave the
conditional and its body unchanged so the code remains self-explanatory and
complies with the rule prohibiting added comments.
| // Update assetId and accountId only if from payment URI (not plain address) | ||
| // Plain addresses should preserve the user's selected asset | ||
| if (urlDirectResult && maybeUrlResult.assetId) { |
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.
Remove the newly added inline comments.
The code is already self-explanatory; these comments violate the project rule against adding comments.
As per coding guidelines, never add code comments unless explicitly requested.
🧹 Suggested cleanup
- // Update assetId and accountId only if from payment URI (not plain address)
- // Plain addresses should preserve the user's selected asset
if (urlDirectResult && maybeUrlResult.assetId) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Update assetId and accountId only if from payment URI (not plain address) | |
| // Plain addresses should preserve the user's selected asset | |
| if (urlDirectResult && maybeUrlResult.assetId) { | |
| if (urlDirectResult && maybeUrlResult.assetId) { |
🤖 Prompt for AI Agents
In `@src/components/Modals/Send/Form.tsx` around lines 313 - 315, Remove the two
newly added inline comment lines immediately above the if statement that reads
"if (urlDirectResult && maybeUrlResult.assetId)" in
src/components/Modals/Send/Form.tsx; leave the conditional and its body
unchanged so the code remains self-explanatory and complies with the rule
prohibiting added comments.
Description
Set the asset in the send modal after scanning only if it was a scheme address in the QR code, so we can select the asset then scan a QR code and the asset stay the one we've selected
Issue (if applicable)
closes #11793
Risk
Low
Testing
Engineering
Operations
Screenshots (if applicable)
https://jam.dev/c/6d4cd6e4-d65d-406b-bb7e-42ed7beb8d91
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.