CYS - Core: fix Product Rating block renders (#45600)
* CYS - Core: fix Product Rating block renders * add comment * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
e5d33df9ab
commit
25c804ae7c
|
@ -16,6 +16,8 @@ import { useQuery } from '@woocommerce/navigation';
|
|||
// @ts-expect-error No types for this exist yet.
|
||||
import useSiteEditorSettings from '@wordpress/edit-site/build-module/components/block-editor/use-site-editor-settings';
|
||||
import { useCallback, useContext, useMemo } from '@wordpress/element';
|
||||
// @ts-expect-error No types for this exist yet.
|
||||
import { store as editSiteStore } from '@wordpress/edit-site/build-module/store';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -78,8 +80,18 @@ export const BlockEditorContainer = () => {
|
|||
[]
|
||||
);
|
||||
|
||||
// This is necessary to avoid this issue: https://github.com/woocommerce/woocommerce/issues/45593
|
||||
// Related PR: https://github.com/woocommerce/woocommerce/pull/45600
|
||||
const { templateType } = useSelect( ( select ) => {
|
||||
const { getEditedPostType } = unlock( select( editSiteStore ) );
|
||||
|
||||
return {
|
||||
templateType: getEditedPostType(),
|
||||
};
|
||||
}, [] );
|
||||
|
||||
const [ blocks, , onChange ] = useEditorBlocks(
|
||||
'wp_template',
|
||||
templateType,
|
||||
currentTemplate?.id ?? ''
|
||||
);
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
CYS - Core: fix Product Rating block renders
|
Loading…
Reference in New Issue