Skip to content

Commit

Permalink
CYS - Core: fix Product Rating block renders (#45600)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gigitux and github-actions committed Mar 15, 2024
1 parent e5d33df commit 25c804a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -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
Expand Down Expand Up @@ -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 ?? ''
);

Expand Down
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

CYS - Core: fix Product Rating block renders

0 comments on commit 25c804a

Please sign in to comment.