Skip to content

Commit d5e19f6

Browse files
clementlemarc-certuapskelin
authored andcommitted
fix: skip waiting for polyfill in case already loaded (#851)
Check that polyfill are not already loaded
1 parent 003868c commit d5e19f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/base/src/compatibility/whenPolyfillLoaded.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const whenPolyfillLoaded = () => {
66
}
77

88
polyfillLoadedPromise = new Promise(resolve => {
9-
if (window.WebComponents && window.WebComponents.waitFor) {
9+
if (window.WebComponents
10+
&& !window.WebComponents.ready
11+
&& window.WebComponents.waitFor) {
1012
// the polyfill loader is present
1113
window.WebComponents.waitFor(() => {
1214
// the polyfills are loaded, safe to execute code depending on their APIs

0 commit comments

Comments
 (0)