Skip to content

Commit

Permalink
Remove the synced to unsynced conversion call
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Jun 20, 2023
1 parent d477199 commit a309562
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
} from '@wordpress/block-editor';
import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
import { ungroup } from '@wordpress/icons';
import { cloneBlock } from '@wordpress/blocks';

export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
const hasAlreadyRendered = useHasRecursion( ref );
Expand All @@ -55,25 +54,12 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
const { __experimentalConvertBlockToStatic: convertBlockToStatic } =
useDispatch( reusableBlocksStore );

const { replaceBlocks } = useDispatch( blockEditorStore );

const [ blocks, onInput, onChange ] = useEntityBlockEditor(
'postType',
'wp_block',
{ id: ref }
);

if (
hasResolved &&
record?.meta?.sync_status === 'unsynced' &&
blocks.length > 0
) {
replaceBlocks(
clientId,
blocks.map( ( block ) => cloneBlock( block ) )
);
}

const [ title, setTitle ] = useEntityProp(
'postType',
'wp_block',
Expand Down

0 comments on commit a309562

Please sign in to comment.