From 804075311911e7480ba592c87588bf07e7f2fff9 Mon Sep 17 00:00:00 2001 From: pokkst Date: Sat, 11 Mar 2023 18:40:54 -0600 Subject: [PATCH] Add some comments --- .../java/net/mynero/wallet/fragment/send/SendFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java b/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java index ea4759e..e2141aa 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java @@ -256,14 +256,18 @@ public class SendFragment extends Fragment { int currentOutputs = getDestCount(); UriData uriData = UriData.parse(editable.toString()); if(uriData != null) { + // we have valid address boolean hasPaymentId = uriData.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(); addressField.setText(null); } else if(currentOutputs == 1 && hasPaymentId) { + // show add output button: we are sending to integrated address 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); } }