From 2c027243f977a7f039878963da4dfb018b8b3455 Mon Sep 17 00:00:00 2001 From: George Hotelling Date: Mon, 16 Mar 2020 16:53:04 -0400 Subject: [PATCH] Replace cleanBlocks with standard cloneBlocks --- packages/block-library/src/query/edit.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/block-library/src/query/edit.js b/packages/block-library/src/query/edit.js index 5ce6a74a06354..ab75484b67adb 100644 --- a/packages/block-library/src/query/edit.js +++ b/packages/block-library/src/query/edit.js @@ -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 },