Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Remove error banners from native media&text and audio blocks #39694

Merged
merged 2 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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