mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Make sure tha allViews are ready in remote explorer
Part of https://github.com/microsoft/vscode-remote-release/issues/1847
This commit is contained in:
@@ -350,22 +350,26 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
|
||||
}));
|
||||
|
||||
this._register(this.viewsModel.onDidChangeActiveViews((viewDescriptors) => {
|
||||
viewDescriptors.forEach(descriptor => {
|
||||
let filterOnValue = this.getFilterOn(descriptor);
|
||||
if (!filterOnValue) {
|
||||
return;
|
||||
}
|
||||
if (!this.allViews.has(filterOnValue)) {
|
||||
this.allViews.set(filterOnValue, new Map());
|
||||
}
|
||||
this.allViews.get(filterOnValue)!.set(descriptor.id, descriptor);
|
||||
if (filterOnValue !== this.filterValue) {
|
||||
this.viewsModel.setVisible(descriptor.id, false);
|
||||
}
|
||||
});
|
||||
this.updateAllViews(viewDescriptors);
|
||||
}));
|
||||
}
|
||||
|
||||
private updateAllViews(viewDescriptors: IViewDescriptor[]) {
|
||||
viewDescriptors.forEach(descriptor => {
|
||||
let filterOnValue = this.getFilterOn(descriptor);
|
||||
if (!filterOnValue) {
|
||||
return;
|
||||
}
|
||||
if (!this.allViews.has(filterOnValue)) {
|
||||
this.allViews.set(filterOnValue, new Map());
|
||||
}
|
||||
this.allViews.get(filterOnValue)!.set(descriptor.id, descriptor);
|
||||
if (filterOnValue !== this.filterValue) {
|
||||
this.viewsModel.setVisible(descriptor.id, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected addConstantViewDescriptors(constantViewDescriptors: IViewDescriptor[]) {
|
||||
constantViewDescriptors.forEach(viewDescriptor => this.constantViewDescriptors.set(viewDescriptor.id, viewDescriptor));
|
||||
}
|
||||
@@ -415,6 +419,10 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
|
||||
}
|
||||
|
||||
onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] {
|
||||
// Check that allViews is ready
|
||||
if (this.allViews.size === 0) {
|
||||
this.updateAllViews(this.viewsModel.viewDescriptors);
|
||||
}
|
||||
const panels: ViewletPanel[] = super.onDidAddViews(added);
|
||||
for (let i = 0; i < added.length; i++) {
|
||||
if (this.constantViewDescriptors.has(added[i].viewDescriptor.id)) {
|
||||
|
||||
Reference in New Issue
Block a user