fix(core): update

This commit is contained in:
Philipp Kunz 2022-01-06 21:53:21 +01:00
parent cc6f14551f
commit 68f11d7e76

View File

@ -20,7 +20,7 @@ export class DeesElement extends plugins.lit.LitElement {
});
}
public connectedCallback() {
public async connectedCallback() {
super.connectedCallback();
this.domtoolsPromise.then(async (domtools) => {
this.themeSubscription = domtools.themeManager.themeObservable.subscribe((goBrightArg) => {
@ -30,7 +30,8 @@ export class DeesElement extends plugins.lit.LitElement {
this.dispatchEvent(new CustomEvent('deesElementConnected'));
}
public disconnectedCallback() {
public async disconnectedCallback() {
await this.domtoolsPromise;
super.disconnectedCallback();
this.themeSubscription.unsubscribe();
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));