Skip to content

Commit

Permalink
Remove error banners from native media&text and audio blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mchowning committed Mar 31, 2022
1 parent b903fc2 commit c8de7a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
5 changes: 0 additions & 5 deletions packages/block-library/src/audio/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ function AudioEdit( {

const { createErrorNotice } = useDispatch( noticesStore );

const onError = () => {
createErrorNotice( __( 'Failed to insert audio file.' ) );
};

function toggleAttribute( attribute ) {
return ( newValue ) => {
setAttributes( { [ attribute ]: newValue } );
Expand Down Expand Up @@ -144,7 +140,6 @@ function AudioEdit( {
<MediaUploadProgress
mediaId={ id }
onFinishMediaUploadWithSuccess={ onFileChange }
onFinishMediaUploadWithFailure={ onError }
onMediaUploadStateReset={ onFileChange }
containerStyle={ styles.progressContainer }
progressBarStyle={ styles.progressBar }
Expand Down
15 changes: 1 addition & 14 deletions packages/block-library/src/media-text/media-container.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import { Component } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { isURL, getProtocol } from '@wordpress/url';
import { compose, withPreferredColorScheme } from '@wordpress/compose';
import { withDispatch } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';

/**
* Internal dependencies
Expand Down Expand Up @@ -152,10 +150,6 @@ class MediaContainer extends Component {
}

finishMediaUploadWithFailure() {
const { createErrorNotice } = this.props;

createErrorNotice( __( 'Failed to insert media.' ) );

this.setState( { isUploadInProgress: false } );
}

Expand Down Expand Up @@ -381,11 +375,4 @@ class MediaContainer extends Component {
}
}

export default compose( [
withDispatch( ( dispatch ) => {
const { createErrorNotice } = dispatch( noticesStore );

return { createErrorNotice };
} ),
withPreferredColorScheme,
] )( MediaContainer );
export default compose( [ withPreferredColorScheme ] )( MediaContainer );

0 comments on commit c8de7a9

Please sign in to comment.