mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix errors throw when doing validity checks (#11171)
This commit is contained in:
@@ -60,7 +60,7 @@ export interface IModelStore {
|
|||||||
getComponentDescriptor(componentId: string): IComponentDescriptor;
|
getComponentDescriptor(componentId: string): IComponentDescriptor;
|
||||||
registerComponent(component: IComponent): void;
|
registerComponent(component: IComponent): void;
|
||||||
unregisterComponent(component: IComponent): void;
|
unregisterComponent(component: IComponent): void;
|
||||||
getComponent(componentId: string): IComponent;
|
getComponent(componentId: string): IComponent | undefined;
|
||||||
/**
|
/**
|
||||||
* Runs on a component immediately if the component exists, or runs on
|
* Runs on a component immediately if the component exists, or runs on
|
||||||
* registration of the component otherwise
|
* registration of the component otherwise
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ export abstract class ContainerBase<T> extends ComponentBase {
|
|||||||
super(_changeRef, _el);
|
super(_changeRef, _el);
|
||||||
this.items = [];
|
this.items = [];
|
||||||
this._validations.push(() => this.items.every(item => {
|
this._validations.push(() => this.items.every(item => {
|
||||||
return this.modelStore.getComponent(item.descriptor.id).valid;
|
return this.modelStore.getComponent(item.descriptor.id)?.valid || false;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class ModelStore implements IModelStore {
|
|||||||
// TODO notify model for cleanup
|
// TODO notify model for cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
getComponent(componentId: string): IComponent {
|
getComponent(componentId: string): IComponent | undefined {
|
||||||
return this._componentMappings[componentId];
|
return this._componentMappings[componentId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user