Skip to content

Commit

Permalink
get block editing mode from hook not prop - misread code elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Oct 2, 2024
1 parent b04d1b2 commit b779041
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/cover/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
useInnerBlocksProps,
__experimentalUseGradient,
store as blockEditorStore,
useBlockEditingMode,
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';
Expand Down Expand Up @@ -74,7 +75,6 @@ const isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );
function CoverEdit( {
attributes,
clientId,
blockEditingMode,
isSelected,
overlayColor,
setAttributes,
Expand Down Expand Up @@ -279,6 +279,7 @@ function CoverEdit( {
const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;

const blockEditingMode = useBlockEditingMode();
const hasNonContentControls = blockEditingMode === 'default';

const [ resizeListener, { height, width } ] = useResizeObserver();
Expand Down

0 comments on commit b779041

Please sign in to comment.