diff --git a/packages/block-library/src/video/edit.js b/packages/block-library/src/video/edit.js index f0eb10c85a66b1..e60ce5852700cf 100644 --- a/packages/block-library/src/video/edit.js +++ b/packages/block-library/src/video/edit.js @@ -6,9 +6,7 @@ import { BaseControl, Button, Disabled, - IconButton, PanelBody, - ToolbarGroup, withNotices, } from '@wordpress/components'; import { @@ -18,6 +16,7 @@ import { MediaPlaceholder, MediaUpload, MediaUploadCheck, + MediaReplaceFlow, RichText, } from '@wordpress/block-editor'; import { Component, createRef } from '@wordpress/element'; @@ -147,16 +146,11 @@ class VideoEdit extends Component { attributes, setAttributes, } = this.props; - const { editing } = this.state; - const switchToEditing = () => { - this.setState( { editing: true } ); - }; const onSelectVideo = ( media ) => { if ( ! media || ! media.url ) { // in this case there was an error and we should continue in the editing state // previous attributes should be removed because they may be temporary blob urls setAttributes( { src: undefined, id: undefined } ); - switchToEditing(); return; } // sets the block's attribute and updates the edit component from the @@ -165,7 +159,7 @@ class VideoEdit extends Component { this.setState( { src: media.url, editing: false } ); }; - if ( editing ) { + if ( ! src ) { return ( } @@ -185,14 +179,14 @@ class VideoEdit extends Component { return ( <> - - - +