Skip to content

Commit

Permalink
Site Editor: Fix incorrect 'useSelect' usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jul 17, 2023
1 parent 90c64a8 commit cbf199e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/edit-site/src/components/save-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ const EntitiesSavedStatesForPreview = ( { onClose } ) => {
activateSaveLabel = __( 'Activate' );
}

const { getTheme } = useSelect( coreStore );
const theme = getTheme( currentlyPreviewingTheme() );
const themeName = useSelect( ( select ) => {
const theme = select( coreStore ).getTheme(
currentlyPreviewingTheme()
);

return theme?.name?.rendered;
}, [] );

const additionalPrompt = (
<p>
{ sprintf(
'Saving your changes will change your active theme to %1$s.',
theme?.name?.rendered
'Saving your changes will change your active theme to %s.',
themeName
) }
</p>
);
Expand Down

0 comments on commit cbf199e

Please sign in to comment.