Skip to content

Commit 5d0c03e

Browse files
authored
[rnmobile] Release 1.16.0 to master (#18261)
* Force block inserter to re-render on device rotation (#18101) * Force block inserter to re-render on device rotation * Dummy * Revert "Dummy" This reverts commit 037f076. * Add left right borders to inner blocks (#18109) * [Mobile]Remove alignment options from Media & Text until they are fixed (#18112) * Remove alignment options temporarily * Dummy commit * Fix: remove getItemLayout which causes scroll position issue (#18060) * Fix: Media & Text Loses upload status if post is closed/reopened during the upload (#18137) * Prevent deleting mediaType on upload progress * Call onMediaUpdate instead of onSelectMedia * Dummy commit * Revert "Dummy commit" This reverts commit 5ce06d6. * Limit requestMediaImport calls for only image type * Update comment * Dummy commit * Revert "Dummy commit" This reverts commit 99584e4. * Fix handling of pasted images and prevent thumbnail uploads (#18215) * Fix handling of pasted images and prevent thumbnail uploads * Fix lint errors * Remove check for image for sync. * Include the RN mobile releases branch in Travis branches
1 parent 3d6392d commit 5d0c03e

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ branches:
2121
only:
2222
- master
2323
- rnmobile/master
24+
- rnmobile/releases
2425
- /wp\/.*/
2526

2627
env:

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,18 @@ export class ImageEdit extends React.Component {
104104
console.warn( 'Attributes has id with no url.' );
105105
}
106106

107+
// Detect any pasted image and start an upload
108+
if ( ! attributes.id && attributes.url && attributes.url.indexOf( 'file:' ) === 0 ) {
109+
requestMediaImport( attributes.url, ( id, url ) => {
110+
if ( url ) {
111+
setAttributes( { id, url } );
112+
}
113+
} );
114+
}
115+
116+
// Make sure we mark any temporary images as failed if they failed while
117+
// the editor wasn't open
107118
if ( attributes.id && attributes.url && ! isURL( attributes.url ) ) {
108-
if ( attributes.url.indexOf( 'file:' ) === 0 ) {
109-
requestMediaImport( attributes.url, ( id, url ) => {
110-
if ( url ) {
111-
setAttributes( { id, url } );
112-
}
113-
} );
114-
}
115119
mediaUploadSync();
116120
}
117121
}

packages/block-library/src/media-text/media-container.native.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44
import { View, ImageBackground, Text, TouchableWithoutFeedback } from 'react-native';
55
import {
6-
requestMediaImport,
76
mediaUploadSync,
87
requestImageFailedRetryDialog,
98
requestImageUploadCancelDialog,
@@ -62,17 +61,11 @@ class MediaContainer extends Component {
6261
}
6362

6463
componentDidMount() {
65-
const { mediaId, mediaUrl, onMediaUpdate, mediaType } = this.props;
66-
67-
if ( mediaId && mediaUrl && ! isURL( mediaUrl ) ) {
68-
if ( mediaUrl.indexOf( 'file:' ) === 0 && mediaType === MEDIA_TYPE_IMAGE ) {
69-
// We don't want to call this for video because it is starting a media upload for the cover url
70-
requestMediaImport( mediaUrl, ( id, url ) => {
71-
if ( url ) {
72-
onMediaUpdate( { id, url } );
73-
}
74-
} );
75-
}
64+
const { mediaId, mediaUrl } = this.props;
65+
66+
// Make sure we mark any temporary images as failed if they failed while
67+
// the editor wasn't open
68+
if ( mediaId && mediaUrl && mediaUrl.indexOf( 'file:' ) === 0 ) {
7669
mediaUploadSync();
7770
}
7871
}

0 commit comments

Comments
 (0)