Skip to content

Commit

Permalink
Edit Site: Select templateType from the store inside the useSiteEdito…
Browse files Browse the repository at this point in the history
…rSettings hook (#52503)
  • Loading branch information
arthur791004 committed Jul 14, 2023
1 parent d193660 commit a6389cf
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit a6389cf

Please sign in to comment.