Skip to content

Commit

Permalink
Fix profile deletion context menu not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
zapek committed Nov 16, 2024
1 parent 31e5507 commit 47d9d8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,11 +1067,11 @@ private void createContactTableViewContextMenu()
xContextMenu.setOnShowing((contextMenu, contact) -> {
contextMenu.getItems().stream()
.filter(menuItem -> CHAT_MENU_ID.equals(menuItem.getId()))
.findFirst().ifPresent(menuItem -> menuItem.setDisable(contact != null && contact.getValue().availability() == Availability.OFFLINE));
.findFirst().ifPresent(menuItem -> menuItem.setDisable(contact.getValue().availability() == Availability.OFFLINE));

contextMenu.getItems().stream()
.filter(menuItem -> DELETE_MENU_ID.equals(menuItem.getId()))
.findFirst().ifPresent(menuItem -> menuItem.setDisable(contact != null && !isSubContact(contact) && contact.getValue().profileId() != NO_PROFILE_ID && contact.getValue().profileId() != OWN_PROFILE_ID));
.findFirst().ifPresent(menuItem -> menuItem.setDisable(isSubContact(contact) || contact.getValue().profileId() == NO_PROFILE_ID || contact.getValue().profileId() == OWN_PROFILE_ID));

return contact != null;
});
Expand Down

0 comments on commit 47d9d8b

Please sign in to comment.