fix(wcc-properties): Use LitElement.updated to recreate properties only when selectedItem changes and handle errors; remove custom scheduleUpdate implementation
This commit is contained in:
@@ -925,16 +925,16 @@ export class WccProperties extends DeesElement {
|
||||
this.dashboardRef.buildUrl();
|
||||
}
|
||||
|
||||
public async scheduleUpdate() {
|
||||
try {
|
||||
await this.createProperties();
|
||||
} catch (error) {
|
||||
console.error('Error creating properties:', error);
|
||||
// Clear property content on error to show clean state
|
||||
this.propertyContent = [];
|
||||
protected updated(changedProperties: Map<string, unknown>) {
|
||||
super.updated(changedProperties);
|
||||
|
||||
// Only recreate properties when selectedItem changes
|
||||
if (changedProperties.has('selectedItem')) {
|
||||
this.createProperties().catch(error => {
|
||||
console.error('Error creating properties:', error);
|
||||
this.propertyContent = [];
|
||||
});
|
||||
}
|
||||
// Always call super.scheduleUpdate to ensure component updates
|
||||
super.scheduleUpdate();
|
||||
}
|
||||
|
||||
public selectViewport(viewport: TEnvironment) {
|
||||
|
||||
Reference in New Issue
Block a user