From 2e1244019de0b1c24908ea7928c7f4c0016656a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Tue, 24 Nov 2020 11:08:30 +0100 Subject: [PATCH] Use global saveMetaboxUnsubscribe --- packages/edit-post/src/store/actions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/store/actions.js b/packages/edit-post/src/store/actions.js index 6b91aa8c2ebb8..5dbbaed47b709 100644 --- a/packages/edit-post/src/store/actions.js +++ b/packages/edit-post/src/store/actions.js @@ -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. @@ -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();