Add some comments

This commit is contained in:
pokkst 2023-03-11 18:40:54 -06:00
parent ae4a8724e8
commit 8040753119
No known key found for this signature in database
GPG key ID: 90C2ED85E67A50FF

View file

@ -256,14 +256,18 @@ public class SendFragment extends Fragment {
int currentOutputs = getDestCount(); int currentOutputs = getDestCount();
UriData uriData = UriData.parse(editable.toString()); UriData uriData = UriData.parse(editable.toString());
if(uriData != null) { if(uriData != null) {
// we have valid address
boolean hasPaymentId = uriData.hasPaymentId(); boolean hasPaymentId = uriData.hasPaymentId();
if(currentOutputs > 1 && hasPaymentId) { if(currentOutputs > 1 && hasPaymentId) {
// multiple outputs when pasting/editing in integrated address. this is not allowed
Toast.makeText(getActivity(), getString(R.string.paymentid_paytomany), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), getString(R.string.paymentid_paytomany), Toast.LENGTH_SHORT).show();
addressField.setText(null); addressField.setText(null);
} else if(currentOutputs == 1 && hasPaymentId) { } else if(currentOutputs == 1 && hasPaymentId) {
// show add output button: we are sending to integrated address
mViewModel.setShowAddOutputButton(false); mViewModel.setShowAddOutputButton(false);
} }
} else if(currentOutputs == 1 && !isSendAll()){ } else if(currentOutputs == 1 && !isSendAll()) {
// when send-all is false and this is our only dest and address is invalid, then show add output button
mViewModel.setShowAddOutputButton(true); mViewModel.setShowAddOutputButton(true);
} }
} }