Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix useForcedLayout to re-select inner blocks after we manually insert one #6676

Merged
merged 4 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename mapSelect back to select
opr committed Aug 12, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a6cf619dc9b583ffdcb3935686ecc26de329c322
6 changes: 3 additions & 3 deletions assets/js/blocks/cart-checkout-shared/use-forced-layout.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import {
useMemo,
useState,
} from '@wordpress/element';
import { useSelect, useDispatch, select } from '@wordpress/data';
import { useSelect, useDispatch } from '@wordpress/data';
import {
createBlock,
getBlockType,
@@ -49,10 +49,10 @@ export const useForcedLayout = ( {
useDispatch( 'core/block-editor' );

const { innerBlocks, registeredBlockTypes } = useSelect(
( mapSelect ) => {
( select ) => {
return {
innerBlocks:
mapSelect( 'core/block-editor' ).getBlocks( clientId ),
select( 'core/block-editor' ).getBlocks( clientId ),
registeredBlockTypes: currentRegisteredBlocks.current.map(
( blockName ) => getBlockType( blockName )
),