@@ -202,7 +202,8 @@ public void update() {
202202 }
203203
204204 // existing issue
205- if (!gitHubIssue .isNew ()) {
205+ boolean isExistingIssue = !gitHubIssue .isNew ();
206+ if (isExistingIssue ) {
206207 Issue issue = gitHubIssue .getIssue ();
207208 if (issue != null ) {
208209 // set existing info
@@ -272,9 +273,10 @@ public void update() {
272273 }
273274
274275 // visibility
275- setNewCommentVisible ();
276+ setCommentsSectionVisible (isExistingIssue );
277+ setNewCommentVisible (isExistingIssue );
276278 setCollaboratorsComponentsVisible (isCollaborator );
277- attributesViewPanel .setVisible (! gitHubIssue . isNew () );
279+ attributesViewPanel .setVisible (isExistingIssue );
278280
279281 fireChange ();
280282 }
@@ -511,11 +513,7 @@ public void setErrorMessage(String errorMessage) {
511513 headerErrorLabel .setText (errorMessage );
512514 }
513515
514- private void setNewCommentVisible () {
515- if (gitHubIssue == null ) {
516- return ;
517- }
518- boolean isVisible = !gitHubIssue .isNew (); // existing issue
516+ private void setNewCommentVisible (boolean isVisible ) {
519517 newCommentLabel .setVisible (isVisible );
520518 newCommentTabbedPanel .setVisible (isVisible );
521519 newCommentButton .setVisible (isVisible );
@@ -526,6 +524,10 @@ private void setNewCommentVisible() {
526524 }
527525 }
528526
527+ private void setCommentsSectionVisible (boolean isVisible ) {
528+ commentsCollapsibleSectionPanel .setVisible (isVisible );
529+ }
530+
529531 public void setNewCommentEnabled (boolean isEnabled ) {
530532 newCommentTabbedPanel .setEnabled (isEnabled );
531533 newCommentButton .setEnabled (isEnabled );
0 commit comments