mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Move compatibility to the top of custom panel entrypoint (#6055)
This commit is contained in:
parent
3a5bd7474b
commit
5cb7117656
@ -1,3 +1,4 @@
|
|||||||
|
import "../resources/compatibility";
|
||||||
import { PolymerElement } from "@polymer/polymer";
|
import { PolymerElement } from "@polymer/polymer";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import { loadJS } from "../common/dom/load_resource";
|
import { loadJS } from "../common/dom/load_resource";
|
||||||
@ -17,12 +18,9 @@ let es5Loaded: Promise<unknown> | undefined;
|
|||||||
|
|
||||||
window.loadES5Adapter = () => {
|
window.loadES5Adapter = () => {
|
||||||
if (!es5Loaded) {
|
if (!es5Loaded) {
|
||||||
es5Loaded = Promise.all([
|
es5Loaded = loadJS(
|
||||||
loadJS(
|
`${__STATIC_PATH__}polyfills/custom-elements-es5-adapter.js`
|
||||||
`${__STATIC_PATH__}polyfills/custom-elements-es5-adapter.js`
|
).catch(); // Swallow errors as it raises errors on old browsers.
|
||||||
).catch(),
|
|
||||||
import(/* webpackChunkName: "compat" */ "../resources/compatibility"),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
return es5Loaded;
|
return es5Loaded;
|
||||||
};
|
};
|
||||||
@ -51,7 +49,6 @@ function initialize(panel: CustomPanelInfo, properties: {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (__BUILD__ === "es5") {
|
if (__BUILD__ === "es5") {
|
||||||
// Load ES5 adapter. Swallow errors as it raises errors on old browsers.
|
|
||||||
start = start.then(() => window.loadES5Adapter());
|
start = start.then(() => window.loadES5Adapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user