Skip to content

Commit

Permalink
fix(oauth2): addEventListener only if document state is not 'loading' (
Browse files Browse the repository at this point in the history
…#7828)

Co-authored-by: Tim Lai <timothy.lai@gmail.com>
  • Loading branch information
Bogdan-Hasanov and tim-lai committed Mar 2, 2022
1 parent 544d16d commit 824917c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dev-helpers/oauth2-redirect.html
Expand Up @@ -66,7 +66,11 @@
window.close();
}

window.addEventListener('DOMContentLoaded', function () {
if( document.readyState !== 'loading' ) {
run();
});
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>

0 comments on commit 824917c

Please sign in to comment.