Skip to content
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

This file was deleted.

2 changes: 1 addition & 1 deletion projects/packages/videopress/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-videopress",
"version": "0.10.5-alpha",
"version": "0.10.4",
"description": "VideoPress package",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/videopress/#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/videopress/src/class-package-version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* The Package_Version class.
*/
class Package_Version {
const PACKAGE_VERSION = '0.10.5-alpha';
const PACKAGE_VERSION = '0.10.4';

const PACKAGE_SLUG = 'videopress';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ const usePosterAndTitleUpdate = ( { setAttributes, videoData, onDone } ) => {

Promise.allSettled( updates ).then( () => {
setIsFinishingUpdate( false );
onDone( videoData );
setAttributes( videoData );
onDone();
} );
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,19 +390,11 @@ export default function VideoPressEdit( {

// Render uploading block view
if ( isUploadingFile ) {
const handleDoneUpload = newVideoData => {
const handleDoneUpload = () => {
setIsUploadingFile( false );
if ( isReplacingFile.isReplacing ) {
const newBlockAttributes = {
...attributes,
...newVideoData,
};

// Delete attributes that are not needed.
delete newBlockAttributes.poster;

setIsReplacingFile( { isReplacing: false, prevAttrs: {} } );
replaceBlock( clientId, createBlock( 'videopress/video', newBlockAttributes ) );
replaceBlock( clientId, createBlock( 'videopress/video', { ...attributes } ) );
}
};

Expand Down Expand Up @@ -506,12 +498,8 @@ export default function VideoPressEdit( {
setFileToUpload( media );
} }
onSelectVideoFromLibrary={ media => {
// Depending on the endpoint, `videopress_guid` can be an array or a string.
const mediaGuid = Array.isArray( media.videopress_guid )
? media.videopress_guid[ 0 ]
: media.videopress_guid;
const mediaGuid = media.videopress_guid?.[ 0 ] ?? media.videopress_guid;
if ( ! mediaGuid ) {
debug( 'No media guid provided' );
return;
}

Expand Down