Skip to content
Merged
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
File: Remove 'block-editor' store subscription
  • Loading branch information
Mamaduka committed Jan 3, 2024
commit 08cdfbbf11a57ec3497f8b80c1fa54aee215bc4c
6 changes: 3 additions & 3 deletions packages/block-library/src/file/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
displayPreview,
previewHeight,
} = attributes;
const { media, mediaUpload } = useSelect(
const { getSettings } = useSelect( blockEditorStore );
const { media } = useSelect(
( select ) => ( {
media:
id === undefined
? undefined
: select( coreStore ).getMedia( id ),
mediaUpload: select( blockEditorStore ).getSettings().mediaUpload,
} ),
[ id ]
);
Expand All @@ -93,7 +93,7 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
if ( isBlobURL( href ) ) {
const file = getBlobByURL( href );

mediaUpload( {
getSettings().mediaUpload( {
filesList: [ file ],
onFileChange: ( [ newMedia ] ) => onSelectFile( newMedia ),
onError: onUploadError,
Expand Down