Skip to content

Commit

Permalink
Merge pull request #906 from orogvany/fix_send_panel
Browse files Browse the repository at this point in the history
GUI: fix account ordering on select from account
  • Loading branch information
cryptokat authored May 25, 2018
2 parents cda869e + f3682f4 commit efd2e9d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/semux/gui/panel/SendPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,13 @@ protected void showAddressBook() {
* @return
*/
protected WalletAccount getSelectedAccount() {
int idx = selectFrom.getSelectedIndex();
return (idx == -1) ? null : model.getAccounts().get(idx);
AccountItem selected = (AccountItem) selectFrom.getSelectedItem();
return selected == null ? null
: model.getAccounts()
.stream()
.filter(walletAccount -> Arrays.equals(selected.address, walletAccount.getAddress()))
.findFirst()
.orElse(null);
}

/**
Expand Down

0 comments on commit efd2e9d

Please sign in to comment.