fix(overlays): catch rejected promise

This commit is contained in:
Thijs Louisse 2020-05-18 09:27:09 +02:00
parent dca848e0ac
commit 5114076eb3

View file

@ -133,7 +133,7 @@ export const OverlayMixin = dedupeMixin(
} }
} }
async connectedCallback() { connectedCallback() {
if (super.connectedCallback) { if (super.connectedCallback) {
super.connectedCallback(); super.connectedCallback();
} }
@ -172,9 +172,11 @@ export const OverlayMixin = dedupeMixin(
// We need to prevent that we create a setup/teardown cycle during startup, where it // We need to prevent that we create a setup/teardown cycle during startup, where it
// is common that the overlay system moves around nodes. Therefore, we make the // is common that the overlay system moves around nodes. Therefore, we make the
// teardown async, so that it only happens when we are permanently disconnecting from dom // teardown async, so that it only happens when we are permanently disconnecting from dom
this._overlayDisconnectComplete.then(() => { this._overlayDisconnectComplete
this._teardownOverlayCtrl(); .then(() => {
}); this._teardownOverlayCtrl();
})
.catch(() => {});
} }
} }