Ignore empty wp notice elements. (https://github.com/woocommerce/woocommerce-admin/pull/2552)
This commit is contained in:
parent
0c1ed070b9
commit
f60c96b572
|
@ -84,6 +84,9 @@ class WordPressNotices extends Component {
|
|||
const notice = notices.children[ i ];
|
||||
if ( ! notice ) {
|
||||
continue;
|
||||
} else if ( 0 === notice.innerHTML.length ) {
|
||||
// Ignore empty elements in this part of the DOM.
|
||||
continue;
|
||||
} else if ( ! this.shouldCollapseNotice( notice ) ) {
|
||||
uncollapsedTargetArea.insertAdjacentElement( 'afterend', notice );
|
||||
} else {
|
||||
|
@ -91,8 +94,6 @@ class WordPressNotices extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
count = count - 1; // Remove 1 for `wp-header-end` which is a child of wp__notice-list
|
||||
|
||||
this.props.onCountUpdate( count );
|
||||
this.setState( { count, notices, noticesOpen, screenMeta, screenLinks } );
|
||||
|
||||
|
|
Loading…
Reference in New Issue