From 61c8c7ce3226ad1d2877c6a26a831f02c94064ee Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 9 Mar 2023 16:11:25 +0100 Subject: [PATCH] `ReviewZoneWidget` makes duplicate calls to `show()` + `hide()` (#176641) Fixes #174263 --- .../contrib/comments/browser/commentThreadZoneWidget.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts index 48eb359188287..cfe14c587720d 100644 --- a/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts +++ b/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.ts @@ -285,10 +285,6 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget toggleExpand() { if (this._isExpanded) { this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Collapsed; - this.hide(); - if (!this._commentThread.comments || !this._commentThread.comments.length) { - this.deleteCommentThread(); - } } else { this._commentThread.collapsibleState = languages.CommentThreadCollapsibleState.Expanded; } @@ -468,6 +464,10 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget if (this.editor.hasWidgetFocus()) { this.editor.focus(); } + + if (!this._commentThread.comments || !this._commentThread.comments.length) { + this.deleteCommentThread(); + } } super.hide(); }