From 9cf24d910a985584127c9ec25af8e6e4c85d0789 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 28 Sep 2020 15:28:38 +0200 Subject: [PATCH] properly install polyfill and remove logging --- src/legacy-polyfill.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/legacy-polyfill.js b/src/legacy-polyfill.js index c373d125..8037b900 100644 --- a/src/legacy-polyfill.js +++ b/src/legacy-polyfill.js @@ -27,15 +27,11 @@ import "text-encoding"; import {checkNeedsSyncPromise} from "./matrix/storage/idb/utils.js"; import Promise from "../lib/es6-promise/index.js"; -const flush = Promise._flush; -Promise._flush = function() { - console.log("manually flushing promise queue"); - flush(); +if (typeof window.Promise === "undefined") { + window.Promise = Promise; + // TODO: should be awaited before opening any session in the picker + checkNeedsSyncPromise(); } - -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) {