replace synchronizeBlocksWithTemplate with createBlocksFromInnerBlocksTemplate (https://github.com/woocommerce/woocommerce-blocks/pull/5040)

This commit is contained in:
Seghir Nadir 2021-11-22 13:45:48 +01:00 committed by GitHub
parent 128ef97010
commit d345a0004a
1 changed files with 2 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import {
getBlockType, getBlockType,
Block, Block,
AttributeSource, AttributeSource,
synchronizeBlocksWithTemplate, createBlocksFromInnerBlocksTemplate,
TemplateArray, TemplateArray,
} from '@wordpress/blocks'; } from '@wordpress/blocks';
import { isEqual } from 'lodash'; import { isEqual } from 'lodash';
@ -91,8 +91,7 @@ export const useForcedLayout = ( {
innerBlocks.length === 0 && innerBlocks.length === 0 &&
currentDefaultTemplate.current.length > 0 currentDefaultTemplate.current.length > 0
) { ) {
const nextBlocks = synchronizeBlocksWithTemplate( const nextBlocks = createBlocksFromInnerBlocksTemplate(
innerBlocks,
currentDefaultTemplate.current currentDefaultTemplate.current
); );
if ( ! isEqual( nextBlocks, innerBlocks ) ) { if ( ! isEqual( nextBlocks, innerBlocks ) ) {