fix(core): update

This commit is contained in:
Philipp Kunz 2022-01-07 19:47:05 +01:00
parent d2cd5ce6f3
commit 68bcc10ee6

View File

@ -13,6 +13,9 @@ export class DeesElement extends plugins.lit.LitElement {
private themeSubscription: plugins.smartrx.rxjs.Subscription; private themeSubscription: plugins.smartrx.rxjs.Subscription;
private elementDomReadyDeferred = plugins.domtools.plugins.smartpromise.defer();
public elementDomReady = this.elementDomReadyDeferred.promise;
constructor() { constructor() {
super(); super();
this.domtoolsPromise.then((domtoolsArg) => { this.domtoolsPromise.then((domtoolsArg) => {
@ -29,6 +32,11 @@ export class DeesElement extends plugins.lit.LitElement {
this.dispatchEvent(new CustomEvent('deesElementConnected')); this.dispatchEvent(new CustomEvent('deesElementConnected'));
} }
public firstUpdated(_changedProperties: Map<string | number | symbol, unknown>): void {
super.firstUpdated(_changedProperties);
this.elementDomReadyDeferred.resolve();
}
public async disconnectedCallback() { public async disconnectedCallback() {
await this.domtoolsPromise; await this.domtoolsPromise;
super.disconnectedCallback(); super.disconnectedCallback();