clear the max selection and revalidate the amount when a payment uri sets the send amount

This commit is contained in:
Craig Raw
2026-10-02 13:14:36 +02:00
parent 8b440c4492
commit 4c085e004c
@@ -119,14 +119,7 @@ public class PaymentController extends WalletFormController implements Initializ
private final ChangeListener<String> amountListener = new ChangeListener<>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if(sendController.getUtxoSelector() instanceof MaxUtxoSelector) {
sendController.utxoSelectorProperty().setValue(null);
}
for(Tab tab : sendController.getPaymentTabs().getTabs()) {
PaymentController controller = (PaymentController) tab.getUserData();
controller.setSendMax(false);
}
clearSendMax();
Long recipientValueSats = getRecipientValueSats();
if(recipientValueSats != null) {
@@ -840,8 +833,10 @@ public class PaymentController extends WalletFormController implements Initializ
label.setText(bitcoinURI.getLabel());
}
if(bitcoinURI.getAmount() != null) {
clearSendMax();
setRecipientValueSats(bitcoinURI.getAmount());
setFiatAmount(AppServices.getFiatCurrencyExchangeRate(), bitcoinURI.getAmount());
revalidateAmount();
}
setPayjoinURI(bitcoinURI);
sendController.updateTransaction();
@@ -881,6 +876,17 @@ public class PaymentController extends WalletFormController implements Initializ
return maxButton.isSelected();
}
private void clearSendMax() {
if(sendController.getUtxoSelector() instanceof MaxUtxoSelector) {
sendController.utxoSelectorProperty().setValue(null);
}
for(Tab tab : sendController.getPaymentTabs().getTabs()) {
PaymentController controller = (PaymentController)tab.getUserData();
controller.setSendMax(false);
}
}
public void setSendMax(boolean sendMax) {
maxButton.setSelected(sendMax);
}