Skip to content

Commit

Permalink
Use updatedContext in pattern overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Sep 24, 2024
1 parent f25282d commit af03ccc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/block-editor/src/hooks/use-bindings-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ export const withBlockBindingSupport = createHigherOrderComponent(
const sources = useSelect( ( select ) =>
unlock( select( blocksStore ) ).getAllBlockBindingsSources()
);
const { name, clientId, context } = props;
const hasParentPattern = !! props.context[ 'pattern/overrides' ];
const hasPatternOverridesDefaultBinding =
props.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]
?.source === 'core/pattern-overrides';
const { name, clientId, context, setAttributes } = props;
const blockBindings = useMemo(
() =>
replacePatternOverrideDefaultBindings(
Expand Down Expand Up @@ -196,7 +192,10 @@ export const withBlockBindingSupport = createHigherOrderComponent(
sources,
] );

const { setAttributes } = props;
const hasParentPattern = !! updatedContext[ 'pattern/overrides' ];
const hasPatternOverridesDefaultBinding =
props.attributes.metadata?.bindings?.[ DEFAULT_ATTRIBUTE ]
?.source === 'core/pattern-overrides';

const _setAttributes = useCallback(
( nextAttributes ) => {
Expand Down

0 comments on commit af03ccc

Please sign in to comment.