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.setTextFormatter(new TextFormatter<>(paymentCodeFilter));
|
||||||
searchPayNyms.addEventFilter(KeyEvent.ANY, event -> {
|
searchPayNyms.addEventFilter(KeyEvent.ANY, event -> {
|
||||||
if(event.getCode() == KeyCode.ENTER) {
|
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();
|
event.consume();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -231,10 +234,12 @@ public class PayNymController {
|
|||||||
|
|
||||||
PayNymService.getPayNym(nymIdentifier, true).subscribe(searchedPayNym -> {
|
PayNymService.getPayNym(nymIdentifier, true).subscribe(searchedPayNym -> {
|
||||||
findPayNym.setVisible(false);
|
findPayNym.setVisible(false);
|
||||||
List<PayNym> searchList = new ArrayList<>();
|
if(nymIdentifier.equals(findNymProperty.get())) {
|
||||||
searchList.add(searchedPayNym);
|
List<PayNym> searchList = new ArrayList<>();
|
||||||
followingList.setUserData(Boolean.TRUE);
|
searchList.add(searchedPayNym);
|
||||||
followingList.setItems(FXCollections.observableList(searchList));
|
followingList.setUserData(Boolean.TRUE);
|
||||||
|
followingList.setItems(FXCollections.observableList(searchList));
|
||||||
|
}
|
||||||
}, error -> {
|
}, error -> {
|
||||||
findPayNym.setVisible(false);
|
findPayNym.setVisible(false);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user