Skip to content

Commit

Permalink
Clean up file picker folder updating
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 committed Jul 11, 2019
1 parent b1621c1 commit 691914e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class RemoteFileDialog {
private remoteAgentEnvironment: IRemoteAgentEnvironment | null;
private separator: string;
private onBusyChangeEmitter = new Emitter<boolean>();
private updatingPromise: CancelablePromise<void>[] = [];
private updatingPromise: CancelablePromise<void> | undefined;

protected disposables: IDisposable[] = [
this.onBusyChangeEmitter
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 691914e

Please sign in to comment.