replace synchronizeBlocksWithTemplate with createBlocksFromInnerBlocksTemplate (https://github.com/woocommerce/woocommerce-blocks/pull/5040)
This commit is contained in:
parent
128ef97010
commit
d345a0004a
|
@ -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 ) ) {
|
||||||
|
|
Loading…
Reference in New Issue