fix(core): update

This commit is contained in:
Philipp Kunz 2020-06-01 15:56:32 +00:00
parent 8d628d3285
commit c222a66ead

View File

@ -73,7 +73,6 @@ export class WccDashboard extends LitElement {
this.setWarning(null); this.setWarning(null);
return html`${anonItem.demo()}`; return html`${anonItem.demo()}`;
} else { } else {
this.selectedItem = WccDefaultElement as any;
this.updateSlot(); this.updateSlot();
} }
})()} })()}
@ -81,12 +80,22 @@ export class WccDashboard extends LitElement {
`; `;
} }
private currentlyUpdating: boolean = false;
public async updateSlot() { public async updateSlot() {
if (this.currentlyUpdating) {
return;
}
this.currentlyUpdating = true;
!this.selectedItem ? this.selectedItem = WccDefaultElement as any : null;
const localSelectedItem = this.selectedItem;
this.selectedItem = null;
console.log('updateSlot'); console.log('updateSlot');
const domtools = await plugins.deesDomtools.DomTools.setupDomTools(); const domtools = await plugins.deesDomtools.DomTools.setupDomTools();
domtools.setVirtualViewport(this.selectedViewport); domtools.setVirtualViewport(this.selectedViewport);
await plugins.smartdelay.delayFor(0); await super.performUpdate();
super.performUpdate(); this.selectedItem = localSelectedItem;
await super.performUpdate();
this.currentlyUpdating = false;
} }
public setWarning(warningTextArg: string) { public setWarning(warningTextArg: string) {