Skip to content

Commit

Permalink
Block Editor: Fix incorrect usage of filter with pickBy.
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Feb 24, 2020
1 parent b2fa3a3 commit 3665ec9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
identity,
difference,
omitBy,
filter,
pickBy,
} from 'lodash';

/**
Expand Down Expand Up @@ -409,6 +409,12 @@ function withPersistentBlockChange( reducer ) {
? ! markNextChangeAsNotPersistent
: ! isUpdatingSameBlockAttribute( action, lastAction ),
};
if (
action.type === 'UPDATE_BLOCK_ATTRIBUTES' &&
action.rootClientId
) {
nextState.persistentChangeRootClientId = action.rootClientId;
}

// In comparing against the previous action, consider only those which
// would have qualified as one which would have been ignored or not
Expand Down Expand Up @@ -531,7 +537,7 @@ const withBlockReset = ( reducer ) => ( state, action ) => {
cache: {
...state.cache,
...mapValues(
filter(
pickBy(
flattenBlocks( action.blocks ),
( block ) =>
! isShallowEqual( block, {
Expand Down

0 comments on commit 3665ec9

Please sign in to comment.