Skip to content

Commit a33325c

Browse files
committed
When converting reusable -> regular, replace the block with a copy
Making a copy of the referenced block prevents the regular block from being removed should the reuasble block be later deleted.
1 parent 07e98c5 commit a33325c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/store/effects.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ export default {
477477
const state = store.getState();
478478
const oldBlock = getBlock( state, action.uid );
479479
const reusableBlock = getReusableBlock( state, oldBlock.attributes.ref );
480-
const newBlock = getBlock( state, reusableBlock.uid );
480+
const referencedBlock = getBlock( state, reusableBlock.uid );
481+
const newBlock = createBlock( referencedBlock.name, referencedBlock.attributes );
481482
store.dispatch( replaceBlock( oldBlock.uid, newBlock ) );
482483
},
483484
CONVERT_BLOCK_TO_REUSABLE( action, store ) {

0 commit comments

Comments
 (0)