Skip to content

Commit

Permalink
Prevent disabling Preview button when the post is not saveable.
Browse files Browse the repository at this point in the history
This is ripple effect of adding isPostLocked check in `isEditedPostSaveable` selector from 1dfe125. We can safely remove this check on `Preview` button, because #32341 will prevent any save actions under the hood.
  • Loading branch information
desaiuditd committed Feb 9, 2024
1 parent 61dbf95 commit d177f65
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/editor/src/components/post-preview-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function PostPreviewButton( {
role,
onPreview,
} ) {
const { postId, currentPostLink, previewLink, isSaveable, isViewable } =
const { postId, currentPostLink, previewLink, isViewable } =
useSelect( ( select ) => {
const editor = select( editorStore );
const core = select( coreStore );
Expand All @@ -119,7 +119,6 @@ export default function PostPreviewButton( {
postId: editor.getCurrentPostId(),
currentPostLink: editor.getCurrentPostAttribute( 'link' ),
previewLink: editor.getEditedPostPreviewLink(),
isSaveable: editor.isEditedPostSaveable(),
isViewable: postType?.viewable ?? false,
};
}, [] );
Expand Down Expand Up @@ -168,7 +167,6 @@ export default function PostPreviewButton( {
className={ className || 'editor-post-preview' }
href={ href }
target={ targetId }
disabled={ ! isSaveable }
onClick={ openPreviewWindow }
role={ role }
>
Expand Down

0 comments on commit d177f65

Please sign in to comment.