From d2a48ce3ebe8a5656a6f3dd8430bfbf56f71e7c5 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Mon, 4 Sep 2023 11:02:24 +1200 Subject: [PATCH] Fix dependency and put user patterns at top of list --- packages/block-editor/src/store/selectors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index f31e89d8ec6aa4..d8ef252973c49e 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -2342,6 +2342,7 @@ export const __experimentalGetParsedPattern = createSelector( ( state ) => [ state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, + state?.settings?.__experimentalUserPatternCategories, ] ); @@ -2352,7 +2353,7 @@ const getAllAllowedPatterns = createSelector( const { allowedBlockTypes } = getSettings( state ); - const parsedPatterns = [ ...patterns, ...unsyncedPatterns ] + const parsedPatterns = [ ...unsyncedPatterns, ...patterns ] .filter( ( { inserter = true } ) => !! inserter ) .map( ( { name } ) => __experimentalGetParsedPattern( state, name ) @@ -2366,6 +2367,7 @@ const getAllAllowedPatterns = createSelector( state.settings.__experimentalBlockPatterns, state.settings.__experimentalReusableBlocks, state.settings.allowedBlockTypes, + state?.settings?.__experimentalUserPatternCategories, ] );