From 300ea16aebbfd6fe2cee6950c52ebfd11969cdce Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Wed, 29 Aug 2018 17:52:27 -0700 Subject: [PATCH] Refresh comments panel when it comes into view again, fixes https://github.com/Microsoft/vscode-pull-request-github/issues/334 --- .../parts/comments/electron-browser/commentsPanel.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts index 44c69e089f7..7a890b78107 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts @@ -242,6 +242,18 @@ export class CommentsPanel extends Panel { return true; } + public setVisible(visible: boolean): TPromise { + const wasVisible = this.isVisible(); + return super.setVisible(visible) + .then(() => { + if (this.isVisible()) { + if (!wasVisible) { + this.refresh(); + } + } + }); + } + private refresh(): void { if (this.isVisible()) { this.collapseAllAction.enabled = this.commentsModel.hasCommentThreads();