Skip to content

Commit

Permalink
Fix comment list pane not removing members that have their comments d…
Browse files Browse the repository at this point in the history
…eleted
  • Loading branch information
Col-E committed Feb 29, 2024
1 parent fcd068c commit ad3e121
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ private ClassCommentPane(@Nonnull ClassComments comments) {
* Full re-population of comment data.
*/
private void refresh() {
// Clear out old comment mappings
memberComments.clear();

// Create labels for class + class-comment
Label classPreview = new Label();
Node graphic = cellConfigurationService.graphicOf(classPath);
Expand Down Expand Up @@ -299,10 +302,11 @@ private void onMemberCommentUpdated(@Nonnull ClassMemberPathNode path, @Nullable
if (isApplicableClass(path.getParent())) {
ClassMember member = path.getValue();
Label memberComment = memberComments.get(memberKey(member));
if (memberComment != null)
if (comment != null && memberComment != null)
FxThreadUtil.run(() -> memberComment.setText(comment));
else
FxThreadUtil.run(this::refresh); // Newly commented members trigger a refresh so things are in order.
// Newly commented members and removed comments, trigger a refresh so things are in order.
FxThreadUtil.run(this::refresh);
}
}

Expand Down

0 comments on commit ad3e121

Please sign in to comment.