Skip to content

Commit

Permalink
Use global saveMetaboxUnsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Nov 24, 2020
1 parent 4d8cf8e commit 2e12440
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/edit-post/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ export function showBlockTypes( blockNames ) {
};
}

let saveMetaboxUnsubscribe;

/**
* Returns an action object used in signaling
* what Meta boxes are available in which location.
Expand Down Expand Up @@ -296,7 +298,7 @@ export function* setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {
}

// Save metaboxes when performing a full save on the post.
const saveMetaboxUnsubscribe = subscribe( () => {
saveMetaboxUnsubscribe = subscribe( () => {
const isSavingPost = select( 'core/editor' ).isSavingPost();
const isAutosavingPost = select( 'core/editor' ).isAutosavingPost();

Expand Down

0 comments on commit 2e12440

Please sign in to comment.