Skip to content

Commit

Permalink
fix race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Apr 8, 2024
1 parent d763c67 commit e44d04d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/edit-site/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
] );
};
Expand Down Expand Up @@ -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
);
};

Expand Down

0 comments on commit e44d04d

Please sign in to comment.