From ae4a8724e8ea33f09213442c9f46ba9a6139ed0c Mon Sep 17 00:00:00 2001 From: pokkst Date: Sat, 11 Mar 2023 18:35:36 -0600 Subject: [PATCH] More conditions to account for --- .../mynero/wallet/fragment/send/SendFragment.java | 13 ++++++++++++- 1 file changed, 12 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 4e6f809..ea4759e 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 @@ -202,6 +202,17 @@ public class SendFragment extends Fragment { return true; } + private boolean destsHasPaymentId() { + List> dests = getRawDests(); + for(Pair dest : dests) { + String address = dest.component1(); + UriData uriData = UriData.parse(address); + if(uriData == null) return false; + if(uriData.hasPaymentId()) return true; + } + return false; + } + private void bindObservers() { mViewModel.sendingMax.observe(getViewLifecycleOwner(), sendingMax -> { if (mViewModel.pendingTransaction.getValue() == null) { @@ -216,7 +227,7 @@ public class SendFragment extends Fragment { }); mViewModel.showAddOutputButton.observe(getViewLifecycleOwner(), show -> { - setAddOutputButtonVisibility(show ? View.VISIBLE : View.INVISIBLE); + setAddOutputButtonVisibility((show && !destsHasPaymentId()) ? View.VISIBLE : View.INVISIBLE); }); mViewModel.pendingTransaction.observe(getViewLifecycleOwner(), pendingTx -> {