From c222a66eadfd8da8cdc6694ec210fc974f96731f Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 1 Jun 2020 15:56:32 +0000 Subject: [PATCH] fix(core): update --- ts_web/elements/wcc-dashboard.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ts_web/elements/wcc-dashboard.ts b/ts_web/elements/wcc-dashboard.ts index 18c74d9..1fdabef 100644 --- a/ts_web/elements/wcc-dashboard.ts +++ b/ts_web/elements/wcc-dashboard.ts @@ -73,7 +73,6 @@ export class WccDashboard extends LitElement { this.setWarning(null); return html`${anonItem.demo()}`; } else { - this.selectedItem = WccDefaultElement as any; this.updateSlot(); } })()} @@ -81,12 +80,22 @@ export class WccDashboard extends LitElement { `; } + private currentlyUpdating: boolean = false; 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'); const domtools = await plugins.deesDomtools.DomTools.setupDomTools(); domtools.setVirtualViewport(this.selectedViewport); - await plugins.smartdelay.delayFor(0); - super.performUpdate(); + await super.performUpdate(); + this.selectedItem = localSelectedItem; + await super.performUpdate(); + this.currentlyUpdating = false; } public setWarning(warningTextArg: string) {