-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: #174 zero amount when pasting #180
Conversation
WalkthroughThe pull request introduces a conditional branch in the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant V as SendScanAddressView
participant VM as ViewModel
U->>V: Initiate scan/paste action
V->>VM: Check amountSat value
alt amountSat equals 0
VM->>V: Set sendViewState to .manualEntry
else
VM->>V: Set sendViewState to .reviewPayment
end
Assessment against linked issues
Poem
✨ Finishing Touches
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. 🪧 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: 0
🧹 Nitpick comments (2)
LDKNodeMonday/View/Home/Send/SendScanAddressView.swift (2)
64-71
: Remove redundant assignment in handleScan function.The current implementation sets
viewModel.sendViewState = .reviewPayment
and then immediately follows with a conditional that either sets it to.manualEntry
or.reviewPayment
again. This initial assignment is unnecessary and can be removed for better code clarity.withAnimation { - viewModel.sendViewState = .reviewPayment if viewModel.amountSat == 0 { viewModel.sendViewState = .manualEntry } else { viewModel.sendViewState = .reviewPayment } }
93-100
: Remove redundant assignment in pasteAddress function.Similar to the
handleScan
function, there's a redundant assignment on line 94 that setsviewModel.sendViewState = .reviewPayment
just before the conditional block that sets it again. This initial assignment can be safely removed.withAnimation { - viewModel.sendViewState = .reviewPayment if viewModel.amountSat == 0 { viewModel.sendViewState = .manualEntry } else { viewModel.sendViewState = .reviewPayment } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
LDKNodeMonday/View/Home/Send/SendScanAddressView.swift
(1 hunks)
🔇 Additional comments (1)
LDKNodeMonday/View/Home/Send/SendScanAddressView.swift (1)
95-99
: Good fix for the zero amount issue.This change correctly implements the solution for issue #174. Now when a valid address is pasted but the amount is zero, the user will be directed to the manual entry screen instead of the review payment screen. This improves the user experience by allowing them to input an amount while preserving the pasted address.
ACK |
Closes #174 |
This fixes #174 and shows the manual entry screen if a valid onchain address is pasted but amount is 0.
From the manual entry screen the user can add an amount and see the pasted address.
Summary by CodeRabbit