Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit Site: Fix the pattern with the post types becomes the placeholder pattern when editing template part #52503

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import { store as editSiteStore } from '../../store';
import { unlock } from '../../lock-unlock';
import inserterMediaCategories from './inserter-media-categories';

export default function useSiteEditorSettings( templateType ) {
export default function useSiteEditorSettings() {
const { setIsInserterOpened } = useDispatch( editSiteStore );
const { storedSettings, canvasMode } = useSelect(
const { storedSettings, canvasMode, templateType } = useSelect(
( select ) => {
const { getSettings, getCanvasMode } = unlock(
const { getSettings, getCanvasMode, getEditedPostType } = unlock(
select( editSiteStore )
);
return {
storedSettings: getSettings( setIsInserterOpened ),
canvasMode: getCanvasMode(),
templateType: getEditedPostType(),
};
},
[ setIsInserterOpened ]
Expand Down