Skip to content

Commit

Permalink
fix: skip waiting for polyfill in case already loaded (#851)
Browse files Browse the repository at this point in the history
Check that polyfill are not already loaded
  • Loading branch information
clementlemarc-certua authored and pskelin committed Oct 15, 2019
1 parent 003868c commit d5e19f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/base/src/compatibility/whenPolyfillLoaded.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const whenPolyfillLoaded = () => {
}

polyfillLoadedPromise = new Promise(resolve => {
if (window.WebComponents && window.WebComponents.waitFor) {
if (window.WebComponents
&& !window.WebComponents.ready
&& window.WebComponents.waitFor) {
// the polyfill loader is present
window.WebComponents.waitFor(() => {
// the polyfills are loaded, safe to execute code depending on their APIs
Expand Down

0 comments on commit d5e19f6

Please sign in to comment.