diff --git a/packages/editor/src/components/post-preview-button/index.js b/packages/editor/src/components/post-preview-button/index.js index d1755f96b68615..0429ce691b4f17 100644 --- a/packages/editor/src/components/post-preview-button/index.js +++ b/packages/editor/src/components/post-preview-button/index.js @@ -129,13 +129,17 @@ export default function PostPreviewButton( { const postType = core.getPostType( editor.getCurrentPostType( 'type' ) ); + const canView = postType?.viewable ?? false; + if ( ! canView ) { + return { isViewable: canView }; + } return { postId: editor.getCurrentPostId(), currentPostLink: editor.getCurrentPostAttribute( 'link' ), previewLink: editor.getEditedPostPreviewLink(), isSaveable: editor.isEditedPostSaveable(), - isViewable: postType?.viewable ?? false, + isViewable: canView, }; }, [] );