Skip to content

Commit

Permalink
Media & Text: Display media while uploading (#39275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Mar 9, 2022
1 parent 6693c05 commit be119ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
ExternalLink,
FocalPointPicker,
} from '@wordpress/components';
import { isBlobURL, getBlobTypeByURL } from '@wordpress/blob';
import { pullLeft, pullRight } from '@wordpress/icons';
import { store as coreStore } from '@wordpress/core-data';

Expand Down Expand Up @@ -85,6 +86,10 @@ function attributesFromMedia( {
return;
}

if ( isBlobURL( media.url ) ) {
media.type = getBlobTypeByURL( media.url );
}

let mediaType;
let src;
// For media selections originated from a file upload.
Expand Down

0 comments on commit be119ed

Please sign in to comment.