Skip to content

Commit

Permalink
Launchpad: Refactor launchpad save modal (#29134)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Feb 27, 2023
1 parent 5bceb98 commit 752b1c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: other

Consolidates selector logic in the launchpad save modal
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ export const name = 'launchpad-save-modal';

export const settings = {
render: function LaunchpadSaveModal() {
const isSavingSite = useSelect(
select => select( editorStore ).isSavingNonPostEntityChanges(),
[]
);
const isSavingPost = useSelect( select => select( editorStore ).isSavingPost(), [] );
const isPublishingPost = useSelect( select => select( editorStore ).isPublishingPost(), [] );
const isCurrentPostPublished = useSelect(
select => select( editorStore ).isCurrentPostPublished(),
[]
const { isSavingSite, isSavingPost, isPublishingPost, isCurrentPostPublished } = useSelect(
selector => ( {
isSavingSite: selector( editorStore ).isSavingNonPostEntityChanges(),
isSavingPost: selector( editorStore ).isSavingPost(),
isPublishingPost: selector( editorStore ).isPublishingPost(),
isCurrentPostPublished: selector( editorStore ).isCurrentPostPublished(),
} )
);

const prevIsSavingSite = usePrevious( isSavingSite );
Expand Down

0 comments on commit 752b1c9

Please sign in to comment.