Skip to content

Commit a53a38b

Browse files
Tughypest
authored andcommitted
[RNMobile] Native mobile release v1.8.0 (#16344)
* Revert "Re-enable Video block on Android after Android X migration (#16215)" This reverts commit 284bb17. * Don't forcefully cancel media upload on img/video unmount Manually reverts d554ba3
1 parent 95c515a commit a53a38b

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

packages/block-editor/src/components/block-list/block-mobile-toolbar.native.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,12 @@ export default compose(
5555
order: getBlockIndex( clientId ),
5656
};
5757
} ),
58-
withDispatch( ( dispatch, { clientId, rootClientId, onDelete } ) => {
58+
withDispatch( ( dispatch, { clientId, rootClientId } ) => {
5959
const { removeBlock } = dispatch( 'core/block-editor' );
6060
return {
61-
onDelete() {
61+
onDelete: () => {
6262
Keyboard.dismiss();
6363
removeBlock( clientId, rootClientId );
64-
if ( onDelete ) {
65-
onDelete( clientId );
66-
}
6764
},
6865
};
6966
} ),

packages/block-library/src/image/edit.native.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
mediaUploadSync,
99
requestImageFailedRetryDialog,
1010
requestImageUploadCancelDialog,
11-
requestImageUploadCancel,
1211
} from 'react-native-gutenberg-bridge';
1312
import { isEmpty } from 'lodash';
1413

@@ -31,6 +30,7 @@ import {
3130
} from '@wordpress/block-editor';
3231
import { __, sprintf } from '@wordpress/i18n';
3332
import { isURL } from '@wordpress/url';
33+
import { doAction, hasAction } from '@wordpress/hooks';
3434

3535
/**
3636
* Internal dependencies
@@ -92,8 +92,9 @@ class ImageEdit extends React.Component {
9292
}
9393

9494
componentWillUnmount() {
95-
if ( this.state.isUploadInProgress ) {
96-
requestImageUploadCancel( this.props.attributes.id );
95+
// this action will only exist if the user pressed the trash button on the block holder
96+
if ( hasAction( 'blocks.onRemoveBlockCheckUpload' ) && this.state.isUploadInProgress ) {
97+
doAction( 'blocks.onRemoveBlockCheckUpload', this.props.attributes.id );
9798
}
9899
}
99100

packages/block-library/src/video/edit.native.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
mediaUploadSync,
1212
requestImageFailedRetryDialog,
1313
requestImageUploadCancelDialog,
14-
requestImageUploadCancel,
1514
} from 'react-native-gutenberg-bridge';
1615

1716
/**
@@ -32,6 +31,7 @@ import {
3231
} from '@wordpress/block-editor';
3332
import { __ } from '@wordpress/i18n';
3433
import { isURL } from '@wordpress/url';
34+
import { doAction, hasAction } from '@wordpress/hooks';
3535

3636
/**
3737
* Internal dependencies
@@ -70,8 +70,9 @@ class VideoEdit extends React.Component {
7070
}
7171

7272
componentWillUnmount() {
73-
if ( this.state.isUploadInProgress ) {
74-
requestImageUploadCancel( this.props.attributes.id );
73+
// this action will only exist if the user pressed the trash button on the block holder
74+
if ( hasAction( 'blocks.onRemoveBlockCheckUpload' ) && this.state.isUploadInProgress ) {
75+
doAction( 'blocks.onRemoveBlockCheckUpload', this.props.attributes.id );
7576
}
7677
}
7778

packages/edit-post/src/index.native.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* External dependencies
3+
*/
4+
import { Platform } from 'react-native';
5+
16
/**
27
* WordPress dependencies
38
*/
@@ -31,6 +36,11 @@ export function initializeEditor() {
3136
// eslint-disable-next-line no-undef
3237
if ( typeof __DEV__ === 'undefined' || ! __DEV__ ) {
3338
unregisterBlockType( 'core/code' );
39+
40+
// Disable Video block except for iOS for now.
41+
if ( Platform.OS !== 'ios' ) {
42+
unregisterBlockType( 'core/video' );
43+
}
3444
}
3545

3646
blocksRegistered = true;

0 commit comments

Comments
 (0)