Skip to content

Commit

Permalink
[RNMobile] Remove error banners from native media&text and audio bloc…
Browse files Browse the repository at this point in the history
…ks (#39694)

* Remove error banners from native media&text and audio blocks

* Update changelog
  • Loading branch information
mchowning authored Apr 1, 2022
1 parent 2bdb3a4 commit 08cf4a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions 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 );
2 changes: 2 additions & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For each user feature we should also add a importance categorization label to i

## Unreleased

- [*] Remove banner error notification on upload failure [#39694]

## 1.73.0

- [*] Update react-native-reanimated version to 2.4.1 [#39430]
Expand Down

0 comments on commit 08cf4a9

Please sign in to comment.