Skip to content

Commit dad7c0f

Browse files
committed
Fixes subscription change handler for drafts view
1 parent 8545d8c commit dad7c0f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/views/draftsView.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CancellationToken } from 'vscode';
1+
import type { CancellationToken, TreeViewVisibilityChangeEvent } from 'vscode';
22
import { Disposable, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
33
import type { RepositoriesViewConfig } from '../config';
44
import { Commands } from '../constants';
@@ -91,16 +91,17 @@ export class DraftsView extends ViewBase<'drafts', DraftsViewNode, RepositoriesV
9191
return new DraftsViewNode(this);
9292
}
9393

94-
override async show(options?: { preserveFocus?: boolean | undefined }): Promise<void> {
95-
if (!(await ensurePlusFeaturesEnabled())) return;
96-
94+
protected override onVisibilityChanged(e: TreeViewVisibilityChangeEvent): void {
9795
if (this._disposable == null) {
98-
// this._disposable = Disposable.from(
99-
// this.container.drafts.onDidResetDrafts(() => void this.ensureRoot().triggerChange(true)),
100-
// );
10196
this._disposable = Disposable.from(this.container.subscription.onDidChange(() => this.refresh(true), this));
10297
}
10398

99+
super.onVisibilityChanged(e);
100+
}
101+
102+
override async show(options?: { preserveFocus?: boolean | undefined }): Promise<void> {
103+
if (!(await ensurePlusFeaturesEnabled())) return;
104+
104105
return super.show(options);
105106
}
106107

0 commit comments

Comments
 (0)