Skip to content

Commit

Permalink
media-replace-placeholder: add onFilesUpload prop
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Jun 8, 2020
1 parent 98748af commit bdeb9e5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { uniqueId } from 'lodash';
import { uniqueId, noop } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -37,6 +37,7 @@ const MediaReplaceFlow = ( {
accept,
onSelect,
onSelectURL,
onFilesUpload = noop,
name = __( 'Replace' ),
createNotice,
removeNotice,
Expand Down Expand Up @@ -87,6 +88,7 @@ const MediaReplaceFlow = ( {

const uploadFiles = ( event ) => {
const files = event.target.files;
onFilesUpload( files );
const setMedia = ( [ media ] ) => {
selectMedia( media );
};
Expand Down

0 comments on commit bdeb9e5

Please sign in to comment.