mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-25 08:52:28 +00:00
More conditions to account for
This commit is contained in:
parent
2cc6942e27
commit
ae4a8724e8
1 changed files with 12 additions and 1 deletions
|
@ -202,6 +202,17 @@ public class SendFragment extends Fragment {
|
|||
return true;
|
||||
}
|
||||
|
||||
private boolean destsHasPaymentId() {
|
||||
List<Pair<String, String>> dests = getRawDests();
|
||||
for(Pair<String, String> 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 -> {
|
||||
|
|
Loading…
Reference in a new issue