From 33bbfac7ec646d0cceccf07ee291ae19ed999d95 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 19 Sep 2023 12:28:54 -0700 Subject: [PATCH] better fix --- src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts b/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts index 88c773aa7ee..6197b74a44d 100644 --- a/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts +++ b/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts @@ -28,9 +28,10 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut @IWorkspaceTrustManagementService private readonly _workspaceTrustManagementService: IWorkspaceTrustManagementService, @ILogService private readonly _logService: ILogService) { super(); - this._taskService.onDidReconnectToTasks((() => this._tryRunTasks())); if (this._taskService.isReconnected) { this._tryRunTasks(); + } else { + this._register(Event.once(this._taskService.onDidReconnectToTasks)(() => this._tryRunTasks())); } this._register(this._workspaceTrustManagementService.onDidChangeTrust(async trusted => { if (trusted) {