mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
Remove unnecessary addItem from DeclarativeTable component (#13997)
This commit is contained in:
@@ -277,23 +277,6 @@ export default class DeclarativeTableComponent extends ContainerBase<any, azdata
|
||||
if (isDataPropertyChanged) {
|
||||
this.clearContainer();
|
||||
this._data = finalData;
|
||||
this.data?.forEach(row => {
|
||||
for (let i = 0; i < row.length; i++) {
|
||||
if (this.isComponent(i)) {
|
||||
const itemDescriptor = this.getItemDescriptor(row[i].value as string);
|
||||
if (itemDescriptor) {
|
||||
this.addToContainer(itemDescriptor, {});
|
||||
} else {
|
||||
// This should ideally never happen but it's possible for a race condition to happen when adding/removing components quickly where
|
||||
// the child component is unregistered after it is defined because a component is only unregistered when it's destroyed by Angular
|
||||
// which can take a while and we don't wait on that to happen currently.
|
||||
// While this happening isn't desirable it typically doesn't have a huge impact since the component will still be displayed properly in
|
||||
// most cases
|
||||
this.logService.warn(`Could not find ItemDescriptor for component ${row[i].value} when adding to DeclarativeTable ${this.descriptor.id}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
super.setProperties(properties);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user