From e5c1cd028569fcd631d727a2bfd5dc4db2cfe590 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 11 Jul 2023 23:23:02 +0400 Subject: [PATCH 1/2] Site Editor: Restore quick inserter 'Browse all' button --- .../block-editor/use-site-editor-settings.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/edit-site/src/components/block-editor/use-site-editor-settings.js b/packages/edit-site/src/components/block-editor/use-site-editor-settings.js index 732f662f5ddca..0eb114164a0f2 100644 --- a/packages/edit-site/src/components/block-editor/use-site-editor-settings.js +++ b/packages/edit-site/src/components/block-editor/use-site-editor-settings.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { useSelect } from '@wordpress/data'; +import { useDispatch, useSelect } from '@wordpress/data'; import { useMemo } from '@wordpress/element'; import { store as coreStore } from '@wordpress/core-data'; /** @@ -12,15 +12,19 @@ import { unlock } from '../../lock-unlock'; import inserterMediaCategories from './inserter-media-categories'; export default function useSiteEditorSettings( templateType ) { - const { storedSettings, canvasMode } = useSelect( ( select ) => { - const { getSettings, getCanvasMode } = unlock( - select( editSiteStore ) - ); - return { - storedSettings: getSettings(), - canvasMode: getCanvasMode(), - }; - }, [] ); + const { setIsInserterOpened } = useDispatch( editSiteStore ); + const { storedSettings, canvasMode } = useSelect( + ( select ) => { + const { getSettings, getCanvasMode } = unlock( + select( editSiteStore ) + ); + return { + storedSettings: getSettings( setIsInserterOpened ), + canvasMode: getCanvasMode(), + }; + }, + [ setIsInserterOpened ] + ); const settingsBlockPatterns = storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0 From cb5490946c13643789d68584063aec1cb7840a7c Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Tue, 11 Jul 2023 23:23:21 +0400 Subject: [PATCH 2/2] Remove leftover comment --- packages/edit-site/src/components/block-editor/index.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/edit-site/src/components/block-editor/index.js b/packages/edit-site/src/components/block-editor/index.js index fcd28948ccbb3..e2d9e2680b263 100644 --- a/packages/edit-site/src/components/block-editor/index.js +++ b/packages/edit-site/src/components/block-editor/index.js @@ -1,7 +1,3 @@ -/** - * External dependencies - */ - /** * WordPress dependencies */