Skip to content

Commit

Permalink
Pattern Insertion: Fix the wpcom_pattern_inserted event isn't fired d…
Browse files Browse the repository at this point in the history
…ue to the incorrect pattern list (#87578)
  • Loading branch information
arthur791004 authored Feb 19, 2024
1 parent c3e127f commit 86d9a16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/wpcom-block-editor/src/wpcom/features/tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,9 @@ const getBlocksTracker = ( eventName ) => ( blockIds, fromRootClientId, toRootCl
const maybeTrackPatternInsertion = ( actionData, additionalData ) => {
const { rootClientId, blocks_replaced, insert_method, search_term } = additionalData;
const context = getBlockEventContextProperties( rootClientId );
const {
__experimentalBlockPatterns: patterns,
__experimentalBlockPatternCategories: patternCategories,
} = select( 'core/block-editor' ).getSettings();
const { __experimentalBlockPatternCategories: patternCategories } =
select( 'core/block-editor' ).getSettings();
const patterns = select( 'core/block-editor' ).__experimentalGetAllowedPatterns();

const meta = find( actionData, ( item ) => item?.patternName );
let patternName = meta?.patternName;
Expand Down

0 comments on commit 86d9a16

Please sign in to comment.