Skip to content

Commit

Permalink
Replace cleanBlocks with standard cloneBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
George Hotelling committed Mar 16, 2020
1 parent 0a4058f commit 2c02724
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/block-library/src/query/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,10 @@ class Edit extends Component {
this.setState( { blocksTree: newBlocksTree } );
}

cleanBlock( block ) {
const { name, isValid, attributes, innerBlocks } = block;
return {
name,
attributes: { ...attributes, post: {} },
innerBlocks: innerBlocks.map( ( b ) => this.cleanBlock( b ) ),
isValid,
};
}

updateBlocks( blocks, postId ) {
const { setAttributes } = this.props;
const { blocksTree } = this.state;
const cleanBlocks = blocks.map( this.cleanBlock );
const cleanBlocks = blocks.map( ( block ) => cloneBlock( block ) );
this.setState(
{
blocksTree: { ...( blocksTree || [] ), [ postId ]: blocks },
Expand Down

0 comments on commit 2c02724

Please sign in to comment.