@@ -92,10 +91,7 @@ export default withModuleSettingsFormHelpers(
onOptionChange: ownProps.onOptionChange,
welcomeMessage: ownProps.getOptionValue( SUBSCRIPTION_OPTIONS )?.welcome || '',
unavailableInOfflineMode: isUnavailableInOfflineMode( state, SUBSCRIPTIONS_MODULE_NAME ),
- unavailableInSiteConnectionMode: isUnavailableInSiteConnectionMode(
- state,
- SUBSCRIPTIONS_MODULE_NAME
- ),
+ siteHasConnectedUser: hasConnectedOwner( state ),
};
} )( MessagesSetting )
);
diff --git a/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx b/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx
index 608c1b7e92a24..862a77932b2d7 100644
--- a/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx
+++ b/projects/plugins/jetpack/_inc/client/newsletter/newsletter-categories.jsx
@@ -8,8 +8,8 @@ import React, { useCallback, useMemo } from 'react';
import { connect } from 'react-redux';
import {
isUnavailableInOfflineMode,
- isUnavailableInSiteConnectionMode,
requiresConnection,
+ hasConnectedOwner,
} from 'state/connection';
import { getModule } from 'state/modules';
import Card from '../components/card';
@@ -45,10 +45,10 @@ function NewsletterCategories( props ) {
newsletterCategories,
categories,
unavailableInOfflineMode,
- unavailableInSiteConnectionMode,
subscriptionsModule,
updateFormStateOptionValue,
isSavingAnyOption,
+ siteHasConnectedUser,
} = props;
const handleEnableNewsletterCategoriesToggleChange = useCallback( () => {
@@ -82,11 +82,12 @@ function NewsletterCategories( props ) {
[ checkedCategoriesIds, updateFormStateOptionValue ]
);
+ const isSaving = isSavingAnyOption( [
+ NEWSLETTER_CATEGORIES_ENABLED_OPTION,
+ NEWSLETTER_CATEGORIES_OPTION,
+ ] );
const disabled =
- ! isSubscriptionsActive ||
- unavailableInOfflineMode ||
- unavailableInSiteConnectionMode ||
- isSavingAnyOption( [ NEWSLETTER_CATEGORIES_ENABLED_OPTION, NEWSLETTER_CATEGORIES_OPTION ] );
+ ! siteHasConnectedUser || ! isSubscriptionsActive || unavailableInOfflineMode || isSaving;
return (
{
@@ -63,11 +69,12 @@ function Newsletter( props ) {
hideButton
feature={ FEATURE_NEWSLETTER_JETPACK }
module={ SUBSCRIPTIONS_MODULE_NAME }
+ isDisabled={ ! siteHasConnectedUser }
>
@@ -49,7 +51,7 @@ function PaidNewsletter( props ) {