Skip to content

Commit

Permalink
Refine variable naming for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Siobhan committed Nov 30, 2022
1 parent 9fd94d0 commit 54decbe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,15 @@ function GalleryEdit( props ) {
}

function isValidFileType( file ) {
// It's necessary to retrieve the media type from the raw image data for uploaded images on native.
const image =
// It's necessary to retrieve the media type from the raw image data for already-uploaded images on native.
const nativeBlockData =
Platform.isNative && file.id
? find( imageData, { id: file.id } )
: null;

const mediaTypeSelector = image ? image?.media_type : file.type;
const mediaTypeSelector = nativeBlockData
? nativeBlockData?.media_type
: file.type;

return (
ALLOWED_MEDIA_TYPES.some(
Expand Down

0 comments on commit 54decbe

Please sign in to comment.