diff --git a/packages/edit-site/src/store/actions.js b/packages/edit-site/src/store/actions.js index ff61b4f802152..66b4f80f8a93a 100644 --- a/packages/edit-site/src/store/actions.js +++ b/packages/edit-site/src/store/actions.js @@ -130,8 +130,8 @@ export const addTemplate = */ export const removeTemplate = ( template ) => - ( { registry } ) => { - unlock( registry.dispatch( editorStore ) ).removeTemplates( [ + async ( { registry } ) => { + await unlock( registry.dispatch( editorStore ) ).removeTemplates( [ template, ] ); }; @@ -344,11 +344,11 @@ export function setIsSaveViewOpened( isOpen ) { * reverting the template. Default true. */ export const revertTemplate = - ( template, { allowUndo = true } = {} ) => - ( { registry } ) => { - unlock( registry.dispatch( editorStore ) ).revertTemplate( + ( template, options ) => + async ( { registry } ) => { + await unlock( registry.dispatch( editorStore ) ).revertTemplate( template, - allowUndo + options ); };