ignore a paynym search result that arrives after the search has changed, and stop enter replacing a pasted payment code search with its abbreviated display

This commit is contained in:
Craig Raw
2026-10-05 11:01:00 +02:00
parent 8db14617d8
commit 0340cdbe86
@@ -142,7 +142,10 @@ public class PayNymController {
searchPayNyms.setTextFormatter(new TextFormatter<>(paymentCodeFilter));
searchPayNyms.addEventFilter(KeyEvent.ANY, event -> {
if(event.getCode() == KeyCode.ENTER) {
findNymProperty.set(searchPayNyms.getText());
//An abbreviated payment code is only the display of the one already being searched for
if(!searchPayNyms.getText().contains("...")) {
findNymProperty.set(searchPayNyms.getText());
}
event.consume();
}
});
@@ -231,10 +234,12 @@ public class PayNymController {
PayNymService.getPayNym(nymIdentifier, true).subscribe(searchedPayNym -> {
findPayNym.setVisible(false);
List<PayNym> searchList = new ArrayList<>();
searchList.add(searchedPayNym);
followingList.setUserData(Boolean.TRUE);
followingList.setItems(FXCollections.observableList(searchList));
if(nymIdentifier.equals(findNymProperty.get())) {
List<PayNym> searchList = new ArrayList<>();
searchList.add(searchedPayNym);
followingList.setUserData(Boolean.TRUE);
followingList.setItems(FXCollections.observableList(searchList));
}
}, error -> {
findPayNym.setVisible(false);
});