Refresh comments panel when it comes into view again, fixes https://github.com/Microsoft/vscode-pull-request-github/issues/334

This commit is contained in:
Rachel Macfarlane
2018-08-29 17:52:27 -07:00
parent 8e373c4c7d
commit 300ea16aeb
@@ -242,6 +242,18 @@ export class CommentsPanel extends Panel {
return true;
}
public setVisible(visible: boolean): TPromise<void> {
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();