From 691914eabc8cc49fe2b34872c6e4458d342e62f7 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Thu, 11 Jul 2019 14:40:24 +0200 Subject: [PATCH] Clean up file picker folder updating --- .../services/dialogs/browser/remoteFileDialog.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts b/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts index 7cf915a1235..55699073c09 100644 --- a/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts +++ b/src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts @@ -65,7 +65,7 @@ export class RemoteFileDialog { private remoteAgentEnvironment: IRemoteAgentEnvironment | null; private separator: string; private onBusyChangeEmitter = new Emitter(); - private updatingPromise: CancelablePromise[] = []; + private updatingPromise: CancelablePromise | undefined; protected disposables: IDisposable[] = [ this.onBusyChangeEmitter @@ -735,17 +735,16 @@ export class RemoteFileDialog { this.filePickBox.valueSelection = [this.filePickBox.value.length, this.filePickBox.value.length]; } this.busy = false; - this.updatingPromise.shift(); + this.updatingPromise = undefined; }); }); - this.updatingPromise.push(updatingPromise); - // Always keep one update around so that we can get into the most recent folder. - if (this.updatingPromise.length > 1) { - this.updatingPromise.shift()!.cancel(); + if (this.updatingPromise !== undefined) { + this.updatingPromise.cancel(); } - return updatingPromise; + this.updatingPromise = updatingPromise; + return updatingPromise; } private pathFromUri(uri: URI, endWithSeparator: boolean = false): string { -- GitLab