Skip to content

Commit

Permalink
Fix 'Convert to Regular Block' button
Browse files Browse the repository at this point in the history
Fix 'Convert to Shared Block' showing on shared blocks by having the
convert button always treat 'core/block' blocks as non-static.
  • Loading branch information
noisysocks committed Jul 17, 2018
1 parent 7ed7b47 commit ea710ca
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function SharedBlockConvertButton( {

export default compose( [
withSelect( ( select, { uid } ) => {
const { getBlock, getSharedBlock } = select( 'core/editor' );
const { getBlock } = select( 'core/editor' );
const { getFallbackBlockName } = select( 'core/blocks' );

const block = getBlock( uid );
Expand All @@ -64,7 +64,7 @@ export default compose( [
// Hide 'Convert to Shared Block' on Classic blocks. Showing it causes a
// confusing UX, because of its similarity to the 'Convert to Blocks' button.
isVisible: block.name !== getFallbackBlockName(),
isStaticBlock: ! isSharedBlock( block ) || ! getSharedBlock( block.attributes.ref ),
isStaticBlock: ! isSharedBlock( block ),
};
} ),
withDispatch( ( dispatch, { uid, onToggle = noop } ) => {
Expand Down

0 comments on commit ea710ca

Please sign in to comment.