diff --git a/src/legacy-polyfill.js b/src/legacy-polyfill.js index 0ce493e0..c3c8263b 100644 --- a/src/legacy-polyfill.js +++ b/src/legacy-polyfill.js @@ -15,6 +15,14 @@ limitations under the License. */ // polyfills needed for IE11 +import Promise from "../lib/es6-promise/index.js"; +import {checkNeedsSyncPromise} from "./matrix/storage/idb/utils.js"; + +if (typeof window.Promise === "undefined") { + window.Promise = Promise; + // TODO: should be awaited before opening any session in the picker + checkNeedsSyncPromise(); +} import "core-js/stable"; import "regenerator-runtime/runtime"; import "mdn-polyfills/Element.prototype.closest"; @@ -24,14 +32,6 @@ import "mdn-polyfills/Element.prototype.closest"; // it will also include the file supporting *all* the encodings, // weighing a good extra 500kb :-( import "text-encoding"; -import {checkNeedsSyncPromise} from "./matrix/storage/idb/utils.js"; -import Promise from "../lib/es6-promise/index.js"; - -if (typeof window.Promise === "undefined") { - window.Promise = Promise; - // TODO: should be awaited before opening any session in the picker - checkNeedsSyncPromise(); -} // TODO: contribute this to mdn-polyfills if (!Element.prototype.remove) {