diff --git a/packages/edit-site/src/components/create-pattern-modal/index.js b/packages/edit-site/src/components/create-pattern-modal/index.js index 2cef6b21ebbbad..5180ad5d870684 100644 --- a/packages/edit-site/src/components/create-pattern-modal/index.js +++ b/packages/edit-site/src/components/create-pattern-modal/index.js @@ -54,7 +54,10 @@ export default function CreatePatternModal( { title: name || __( 'Untitled Pattern' ), content: '', status: 'publish', - meta: { sync_status: syncType }, + meta: + syncType === SYNC_TYPES.unsynced + ? { sync_status: syncType } + : undefined, }, { throwOnError: true } ); diff --git a/packages/edit-site/src/components/page-library/use-patterns.js b/packages/edit-site/src/components/page-library/use-patterns.js index 9034dc43421fc0..6f3b7407e917dd 100644 --- a/packages/edit-site/src/components/page-library/use-patterns.js +++ b/packages/edit-site/src/components/page-library/use-patterns.js @@ -145,7 +145,7 @@ const reusableBlockToPattern = ( reusableBlock ) => ( { categories: reusableBlock.wp_pattern, id: reusableBlock.id, name: reusableBlock.slug, - syncStatus: reusableBlock.meta?.sync_status, + syncStatus: reusableBlock.meta?.sync_status || SYNC_TYPES.full, title: reusableBlock.title.raw, type: reusableBlock.type, reusableBlock, diff --git a/packages/editor/src/components/post-sync-status/index.js b/packages/editor/src/components/post-sync-status/index.js index 40476111a82c17..392d33563ef78f 100644 --- a/packages/editor/src/components/post-sync-status/index.js +++ b/packages/editor/src/components/post-sync-status/index.js @@ -26,13 +26,10 @@ export default function PostSyncStatus() { editPost( { meta: { ...meta, - wp_block: - syncStatus === 'unsynced' - ? { sync_status: syncStatus } - : null, + sync_status: syncStatus === 'unsynced' ? syncStatus : null, }, } ); - const syncStatus = meta?.wp_block?.sync_status; + const syncStatus = meta?.sync_status; const isFullySynced = ! syncStatus; return (