Skip to content

Commit

Permalink
add extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Sep 8, 2020
1 parent f0ececd commit f4fadf4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/block-library/src/classic/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ export default class ClassicEdit extends Component {
suffix,
} );

document.addEventListener( 'readystatechange', () => {
if ( document.readyState === 'complete' ) {
this.initialize();
}
} );
if ( document.readyState === 'complete' ) {
this.initialize();
} else {
document.addEventListener( 'readystatechange', () => {
if ( document.readyState === 'complete' ) {
this.initialize();
}
} );
}
}

componentWillUnmount() {
Expand Down

0 comments on commit f4fadf4

Please sign in to comment.