Skip to content

Commit

Permalink
Try to catch errors
Browse files Browse the repository at this point in the history
Cherry-picks #3100
  • Loading branch information
swissspidy authored and westonruter committed Aug 27, 2019
1 parent 8c4e7d5 commit a7878d1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions assets/src/block-validation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ import '../block-editor/store';
const { isEditedPostDirty } = select( 'core/editor' );

subscribe( () => {
if ( ! isEditedPostDirty() ) {
if ( ! isAMPEnabled() ) {
maybeResetValidationErrors();
} else {
updateValidationErrors();
try {
if ( ! isEditedPostDirty() ) {
if ( ! isAMPEnabled() ) {
maybeResetValidationErrors();
} else {
updateValidationErrors();
}
}
}
} catch ( err ) {}
} );

addFilter( 'editor.BlockEdit', 'amp/add-notice', withValidationErrorNotice, 99 );

0 comments on commit a7878d1

Please sign in to comment.