Skip to content

Commit

Permalink
Revert back to boostrapping metadata only when provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Aug 30, 2023
1 parent b657dd3 commit e6dae48
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/blocks/src/api/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,15 @@ export function registerBlockType( blockNameOrMetadata, settings ) {
return;
}

const metadata = isObject( blockNameOrMetadata )
? getBlockSettingsFromMetadata( blockNameOrMetadata )
: getBlockSettingsFromMetadata( settings );

const { addBootstrappedBlockType, addUnprocessedBlockType } = unlock(
dispatch( blocksStore )
);
addBootstrappedBlockType( name, metadata );

if ( isObject( blockNameOrMetadata ) ) {
const metadata = getBlockSettingsFromMetadata( blockNameOrMetadata );
addBootstrappedBlockType( name, metadata );
}

addUnprocessedBlockType( name, settings );

return select( blocksStore ).getBlockType( name );
Expand Down

0 comments on commit e6dae48

Please sign in to comment.