Skip to content

Commit

Permalink
small updates to make the tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed May 28, 2019
1 parent cad1e9c commit a025e97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-editor/src/store/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ const BLOCK_SELECTION_INITIAL_STATE = {
export function blockSelection( state = BLOCK_SELECTION_INITIAL_STATE, action ) {
switch ( action.type ) {
case 'CLEAR_SELECTED_BLOCK':
if ( isEqual( state, BLOCK_SELECTION_INITIAL_STATE ) ) {
return BLOCK_SELECTION_INITIAL_STATE;
}
return {
...BLOCK_SELECTION_INITIAL_STATE,
previousSelection: omit( state, [ 'previousSelection' ] ),
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,7 @@ describe( 'state', () => {
initialPosition: null,
isMultiSelecting: false,
isEnabled: true,
previousSelection: original,
} );
} );

Expand Down

0 comments on commit a025e97

Please sign in to comment.