From 59dc3484532636b6ef4fe1f63abf58eea7070a62 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 18 Sep 2023 15:29:53 -0400 Subject: [PATCH] Fixes workspaces view refresh --- src/views/workspacesView.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/views/workspacesView.ts b/src/views/workspacesView.ts index cb3e023..8a492aa 100644 --- a/src/views/workspacesView.ts +++ b/src/views/workspacesView.ts @@ -1,4 +1,5 @@ -import { Disposable, env, ProgressLocation, Uri, window } from 'vscode'; +import type { Disposable } from 'vscode'; +import { env, ProgressLocation, Uri, window } from 'vscode'; import type { RepositoriesViewConfig } from '../config'; import { Commands } from '../constants'; import type { Container } from '../container'; @@ -24,6 +25,7 @@ export class WorkspacesView extends ViewBase<'workspaces', WorkspacesViewNode, R super(container, 'workspaces', 'Workspaces', 'workspaceView'); this.description = `PREVIEW\u00a0\u00a0☁️`; + this.disposables.push(container.workspaces.onDidResetWorkspaces(() => void this.refresh(true))); } override dispose() { @@ -41,13 +43,6 @@ export class WorkspacesView extends ViewBase<'workspaces', WorkspacesViewNode, R override async show(options?: { preserveFocus?: boolean | undefined }): Promise { if (!(await ensurePlusFeaturesEnabled())) return; - - if (this._disposable == null) { - this._disposable = Disposable.from( - this.container.workspaces.onDidResetWorkspaces(() => void this.ensureRoot().triggerChange(true)), - ); - } - return super.show(options); }