From 18a660965aadf22e644dc42e4b33bcc5bad1a573 Mon Sep 17 00:00:00 2001 From: Miguel Lezama Date: Sun, 25 Aug 2024 11:38:07 -0300 Subject: [PATCH] Newsletter: Email Menu: Don't prompt for connection on simple sites. (#39064) --- .../jetpack/changelog/fix-simple-sites-prompts-connection | 4 ++++ .../plugins/jetpack/extensions/blocks/subscriptions/menu.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/fix-simple-sites-prompts-connection diff --git a/projects/plugins/jetpack/changelog/fix-simple-sites-prompts-connection b/projects/plugins/jetpack/changelog/fix-simple-sites-prompts-connection new file mode 100644 index 0000000000000..17475b319a723 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-simple-sites-prompts-connection @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +wpcom only diff --git a/projects/plugins/jetpack/extensions/blocks/subscriptions/menu.js b/projects/plugins/jetpack/extensions/blocks/subscriptions/menu.js index fb7ab10e95f0a..4fc766c7c88c8 100644 --- a/projects/plugins/jetpack/extensions/blocks/subscriptions/menu.js +++ b/projects/plugins/jetpack/extensions/blocks/subscriptions/menu.js @@ -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'; @@ -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 ); @@ -48,7 +50,7 @@ const NewsletterMenu = () => { { isSendEmailEnabled && ! isPublished && ( <> - { isUserConnected ? ( + { ! shouldPromptForConnection ? ( <>

{ __(