Added function to clear search field when navigating to transactions view, if a selected transaction id is given.

This commit is contained in:
Andrew Lalis 2024-07-21 13:17:58 -04:00
parent b91b0a8263
commit 36c29e0d06
1 changed files with 1 additions and 0 deletions

View File

@ -138,6 +138,7 @@ public class TransactionsViewController implements RouteSelectionListener {
// If a transaction id is given in the route context, navigate to the page it's on and select it.
if (context instanceof RouteContext ctx && ctx.selectedTransactionId != null) {
searchField.setText(null);// First clear the search field if it's already populated.
Profile.getCurrent().dataSource().useRepoAsync(
TransactionRepository.class,
repo -> repo.findById(ctx.selectedTransactionId).ifPresent(tx -> {