Skip to content

Commit

Permalink
mark applying templates as a not persistent change
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Nov 17, 2022
1 parent dfacfd7 commit f69f59d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default function useInnerBlockTemplateSync(
) {
const { getSelectedBlocksInitialCaretPosition, isBlockSelected } =
useSelect( blockEditorStore );
const { replaceInnerBlocks } = useDispatch( blockEditorStore );
const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } =
useDispatch( blockEditorStore );
const innerBlocks = useSelect(
( select ) => select( blockEditorStore ).getBlocks( clientId ),
[ clientId ]
Expand Down Expand Up @@ -81,6 +82,7 @@ export default function useInnerBlockTemplateSync(
);

if ( ! isEqual( nextBlocks, currentInnerBlocks ) ) {
__unstableMarkNextChangeAsNotPersistent();
replaceInnerBlocks(
clientId,
nextBlocks,
Expand Down

0 comments on commit f69f59d

Please sign in to comment.