Skip to content

Commit

Permalink
fix: incompatibility with block conditions with different versions of…
Browse files Browse the repository at this point in the history
… Otter
  • Loading branch information
HardeepAsrani committed Aug 8, 2024
1 parent 3f82aa1 commit 5bea4e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blocks/plugins/conditions/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ const Edit = ({
useEffect( () => {
const c = applyFilters( 'otter.blockConditions.conditions', defaultConditions );

const flat = defaultConditionsKeys.map( i => c?.[i].conditions ).flat();
const conditionsKeys = Object.keys( c ).filter( key => defaultConditionsKeys.includes( key ) );
const flat = conditionsKeys.map( i => c?.[i].conditions ).flat();

flat.splice( 0, 0, {
value: 'none',
label: __( 'Select a condition', 'otter-blocks' ),
Expand Down

0 comments on commit 5bea4e0

Please sign in to comment.