Skip to content

Commit

Permalink
Tidy up title assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Jul 11, 2023
1 parent 9ff50d8 commit f800546
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ export default function useBlockDisplayInformation( clientId ) {
const blockName = getBlockName( clientId );
const blockType = getBlockType( blockName );
if ( ! blockType ) return null;
let title = blockType.title;
const attributes = getBlockAttributes( clientId );
const match = getActiveBlockVariation( blockName, attributes );
const isReusable = isReusableBlock( blockType );
if ( isReusable ) {
title =
__experimentalGetReusableBlockTitle( attributes.ref ) ||
blockType.title;
}
const resusableTitle = isReusableBlock( blockType )
? __experimentalGetReusableBlockTitle( attributes.ref )
: undefined;
const title = resusableTitle || blockType.title;
const isSynced = isReusable || isTemplatePart( blockType );
const positionLabel = getPositionTypeLabel( attributes );
const blockTypeInfo = {
Expand Down

0 comments on commit f800546

Please sign in to comment.