Skip to content

Commit

Permalink
Merge pull request #735 from 3DStreet/fix-readyState
Browse files Browse the repository at this point in the history
Use document.readyState !== 'complete' to be sure startObserving is always executed
  • Loading branch information
kfarr authored Jul 29, 2024
2 parents 2927094 + af8bb01 commit f2592b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function startObserving() {
}

// Wait for the DOM to be fully loaded before starting the observer
if (document.readyState === 'loading') {
if (document.readyState !== 'complete') {
document.addEventListener('DOMContentLoaded', startObserving);
} else {
// DOMContentLoaded has already fired
Expand Down

0 comments on commit f2592b9

Please sign in to comment.