Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,12 @@ export const saveEntityRecord =
( acc, key ) => {
// These properties are persisted in autosaves.
if (
[ 'title', 'excerpt', 'content' ].includes(
key
)
[
'title',
'excerpt',
'content',
'meta',
].includes( key )
Comment on lines +733 to +738

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list to match is below. I wonder if I should extract this into a constant.

const data = [
'title',
'excerpt',
'content',
'meta',
].reduce(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could. It seems we want these two lists to be always in sync. Although I'd expect this to rarely change, especially with the meta prop added.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the list is probably a final for now, so let's keep it as it is.

) {
acc[ key ] = newRecord[ key ];
} else if ( key === 'status' ) {
Expand Down
Loading