mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-10-05 11:08:25 +00:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user