Skip to content

Commit 04a2bbc

Browse files
authored
Prevent showing installable extensions till ready (microsoft#185930)
1 parent 1602ab8 commit 04a2bbc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/vs/workbench/contrib/remote/browser/remoteIndicator.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
113113

114114
private loggedInvalidGroupNames: { [group: string]: boolean } = Object.create(null);
115115
private readonly remoteExtensionMetadata: RemoteExtensionMetadata[];
116-
private _isInitialized: boolean = false;
116+
private remoteMetadataInitialized: boolean = false;
117117
constructor(
118118
@IStatusbarService private readonly statusbarService: IStatusbarService,
119119
@IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
@@ -167,7 +167,6 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
167167

168168
this.updateWhenInstalledExtensionsRegistered();
169169
this.updateRemoteStatusIndicator();
170-
this.initializeRemoteMetadata();
171170
}
172171

173172
private registerActions(): void {
@@ -314,7 +313,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
314313

315314
private async initializeRemoteMetadata(): Promise<void> {
316315

317-
if (this._isInitialized) {
316+
if (this.remoteMetadataInitialized) {
318317
return;
319318
}
320319

@@ -340,7 +339,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
340339
this.remoteExtensionMetadata[i].installed = (await this.extensionManagementService.getInstalled()).find(value => ExtensionIdentifier.equals(value.identifier.id, extensionId)) ? true : false;
341340
}
342341

343-
this._isInitialized = true;
342+
this.remoteMetadataInitialized = true;
344343
}
345344

346345
private updateVirtualWorkspaceLocation() {
@@ -367,6 +366,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
367366
}
368367

369368
this.updateRemoteStatusIndicator();
369+
this.initializeRemoteMetadata();
370370
}
371371

372372
private setConnectionState(newState: 'disconnected' | 'connected' | 'reconnecting'): void {
@@ -760,7 +760,7 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
760760
items.pop(); // remove the separator again
761761
}
762762

763-
if (this.extensionGalleryService.isEnabled()) {
763+
if (this.extensionGalleryService.isEnabled() && this.remoteMetadataInitialized) {
764764

765765
const notInstalledItems: QuickPickItem[] = [];
766766
for (const metadata of this.remoteExtensionMetadata) {
@@ -798,7 +798,6 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
798798
quickPick.items = [];
799799
quickPick.busy = true;
800800
quickPick.placeholder = nls.localize('remote.startActions.installingExtension', 'Installing extension... ');
801-
quickPick.hide();
802801
await this.installAndRunStartCommand(remoteExtension);
803802
}
804803
else {

0 commit comments

Comments
 (0)