From 1b3f1ba4debfe5c4d5bda70e0bfdbd0a84c50c23 Mon Sep 17 00:00:00 2001 From: Robert Anderson Date: Fri, 9 Mar 2018 12:56:17 -0800 Subject: [PATCH] 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. --- editor/store/effects.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/store/effects.js b/editor/store/effects.js index 10a4896ef73e2..e5a530c4e1ae3 100644 --- a/editor/store/effects.js +++ b/editor/store/effects.js @@ -479,7 +479,8 @@ export default { const state = store.getState(); const oldBlock = getBlock( state, action.uid ); const reusableBlock = getReusableBlock( state, oldBlock.attributes.ref ); - const newBlock = getBlock( state, reusableBlock.uid ); + const referencedBlock = getBlock( state, reusableBlock.uid ); + const newBlock = createBlock( referencedBlock.name, referencedBlock.attributes ); store.dispatch( replaceBlock( oldBlock.uid, newBlock ) ); }, CONVERT_BLOCK_TO_REUSABLE( action, store ) {