Skip to content

Commit

Permalink
Newsletter: Email Menu: Don't prompt for connection on simple sites. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lezama authored Aug 25, 2024
1 parent d2a46b6 commit 18a6609
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

wpcom only
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useConnection } from '@automattic/jetpack-connection';
import { isSimpleSite } from '@automattic/jetpack-shared-extension-utils';
import { Button, PanelBody, __experimentalHStack as HStack } from '@wordpress/components'; // eslint-disable-line @wordpress/no-unsafe-wp-apis
import { useSelect } from '@wordpress/data';
import { PluginSidebar } from '@wordpress/edit-post';
Expand Down Expand Up @@ -31,6 +32,7 @@ const NewsletterMenu = () => {

const { isUserConnected } = useConnection();
const connectUrl = `${ window?.Jetpack_Editor_Initial_State?.adminUrl }admin.php?page=my-jetpack#/connection`;
const shouldPromptForConnection = ! isSimpleSite() && ! isUserConnected;

const openPreviewModal = () => setIsPreviewModalOpen( true );
const closePreviewModal = () => setIsPreviewModalOpen( false );
Expand All @@ -48,7 +50,7 @@ const NewsletterMenu = () => {
<SubscribersAffirmation accessLevel={ accessLevel } prePublish={ ! isPublished } />
{ isSendEmailEnabled && ! isPublished && (
<>
{ isUserConnected ? (
{ ! shouldPromptForConnection ? (
<>
<p>
{ __(
Expand Down

0 comments on commit 18a6609

Please sign in to comment.