Skip to content

Commit

Permalink
Reorg the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Oct 20, 2022
1 parent a96c27c commit 5c4e4c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/edit-post/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,16 @@ export const initializeMetaBoxes =

// Save metaboxes on save completion, except for autosaves.
const shouldTriggerMetaboxesSave =
wasSavingPost && ! wasAutosavingPost && ! isSavingPost;
wasSavingPost &&
! wasAutosavingPost &&
! isSavingPost &&
select.hasMetaBoxes();

// Save current state for next inspection.
wasSavingPost = isSavingPost;
wasAutosavingPost = isAutosavingPost;

if ( shouldTriggerMetaboxesSave && select.hasMetaBoxes() ) {
if ( shouldTriggerMetaboxesSave ) {
await dispatch.requestMetaBoxUpdates();
}
} );
Expand Down

0 comments on commit 5c4e4c7

Please sign in to comment.