Switch conditional block to use postType from context instead of productType

This commit is contained in:
Matt Sherman 2023-10-19 07:33:29 -04:00
parent b40f9d2035
commit abd71af40a
1 changed files with 4 additions and 4 deletions

View File

@ -26,17 +26,17 @@ export function Edit( {
attributes,
context,
}: ProductEditorBlockEditProps< ConditionalBlockAttributes > ) {
const { productType } = context;
const { postType } = context;
const blockProps = useWooBlockProps( attributes );
const { mustMatch } = attributes;
const productId = useEntityId( 'postType', productType );
const productId = useEntityId( 'postType', postType );
const displayBlocks = useSelect(
( select ) => {
const product: Product = select( 'core' ).getEditedEntityRecord(
'postType',
productType,
postType,
productId
);
@ -47,7 +47,7 @@ export function Edit( {
}
return true;
},
[ productType, productId, mustMatch ]
[ postType, productId, mustMatch ]
);
return (