Skip to content

Commit

Permalink
fix: rename postId to currentPostId & used getCurrentPostId instead o…
Browse files Browse the repository at this point in the history
…f getEditedPostAttribute
  • Loading branch information
sarthaknagoshe2002 committed Nov 18, 2024
1 parent a8178e0 commit 38fd027
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class PostPublishPanel extends Component {
( prevProps.isPublished &&
! this.props.isSaving &&
this.props.isDirty ) ||
this.props.postId !== prevProps.postId
this.props.currentPostId !== prevProps.currentPostId
) {
this.props.onClose();
}
Expand All @@ -76,7 +76,7 @@ export class PostPublishPanel extends Component {
onTogglePublishSidebar,
PostPublishExtension,
PrePublishExtension,
postId,
currentPostId,
...additionalProps
} = this.props;
const {
Expand Down Expand Up @@ -156,6 +156,7 @@ export default compose( [
const { getPostType } = select( coreStore );
const {
getCurrentPost,
getCurrentPostId,
getEditedPostAttribute,
isCurrentPostPublished,
isCurrentPostScheduled,
Expand All @@ -179,7 +180,7 @@ export default compose( [
isSaving: isSavingPost() && ! isAutosavingPost(),
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
isScheduled: isCurrentPostScheduled(),
postId: getEditedPostAttribute( 'id' ),
currentPostId: getCurrentPostId(),
};
} ),
withDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {
Expand Down

0 comments on commit 38fd027

Please sign in to comment.