Skip to content

Commit

Permalink
Skip 'Site Updated' message if only post meta was saved
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiomorales committed Jun 4, 2024
1 parent e5d2a5a commit edffcea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,12 @@ export const saveEditedEntityRecord =
name,
recordId
);

const record = { [ entityIdKey ]: recordId, ...edits };
return await dispatch.saveEntityRecord( kind, name, record, options );
return await {
values: dispatch.saveEntityRecord( kind, name, record, options ),
metaChange: !! edits?.meta,
};
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/store/private-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const saveDirtyEntities =
registry
.dispatch( noticesStore )
.createErrorNotice( __( 'Saving failed.' ) );
} else {
} else if ( ! values.every( ( value ) => value.metaChange ) ) {
registry
.dispatch( noticesStore )
.createSuccessNotice( __( 'Site updated.' ), {
Expand Down

0 comments on commit edffcea

Please sign in to comment.