Skip to content

Commit

Permalink
Fix ready state event
Browse files Browse the repository at this point in the history
  • Loading branch information
karankraina authored Jul 12, 2024
1 parent 80edab0 commit c7291ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const querySelector = '$$overlayQuerySelector$$';
if (isClient()) {
if (!window.executed) {
window.executed = true;
window.addEventListener('DOMContentLoaded', startObserver);
if (document.readyState === 'complete') {
startObserver()
} else {
window.addEventListener('DOMContentLoaded', startObserver);
}
window.onerror = errorHandler;
}
}
Expand Down

0 comments on commit c7291ae

Please sign in to comment.