Skip to content

Commit

Permalink
Enable Subscribers tab for self-hosted (#98144)
Browse files Browse the repository at this point in the history
  • Loading branch information
a8ck3n authored Jan 10, 2025
1 parent 75c4627 commit 4bc5fe1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/blocks/stats-navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import siteHasFeature from 'calypso/state/selectors/site-has-feature';
import {
getJetpackStatsAdminVersion,
getSiteOption,
isJetpackSite,
isSimpleSite,
} from 'calypso/state/sites/selectors';
import getSiteAdminUrl from 'calypso/state/sites/selectors/get-site-admin-url';
Expand Down Expand Up @@ -67,6 +68,7 @@ class StatsNavigation extends Component {
isWordAds: PropTypes.bool,
isSubscriptionsModuleActive: PropTypes.bool,
isSimple: PropTypes.bool,
isSiteJetpackNotAtomic: PropTypes.bool,
hasVideoPress: PropTypes.bool,
selectedItem: PropTypes.oneOf( Object.keys( navItems ) ).isRequired,
siteId: PropTypes.number,
Expand Down Expand Up @@ -146,6 +148,7 @@ class StatsNavigation extends Component {
isWordAds,
isSubscriptionsModuleActive,
isSimple,
isSiteJetpackNotAtomic,
siteId,
} = this.props;

Expand All @@ -168,7 +171,10 @@ class StatsNavigation extends Component {
return false;
}

return isSimple || isSubscriptionsModuleActive;
// The value of isSubscriptionsModuleActive is null in Odyssey Stats so we default to showing the tab.
// Maintains existing behaviour inside wp-admin for self-hosted sites.
// For DotCom sites, it will only be shown on Simple sites or if subs are enabled.
return isSiteJetpackNotAtomic || isSimple || isSubscriptionsModuleActive;

default:
return true;
Expand Down Expand Up @@ -313,6 +319,7 @@ export default connect(
canCurrentUser( state, siteId, 'manage_options' ),
isSubscriptionsModuleActive: isJetpackModuleActive( state, siteId, 'subscriptions' ),
isSimple: isSimpleSite( state, siteId ),
isSiteJetpackNotAtomic: isJetpackSite( state, siteId, { treatAtomicAsJetpackSite: false } ),
hasVideoPress: siteHasFeature( state, siteId, 'videopress' ),
siteId,
pageModuleToggles: getModuleToggles( state, siteId, [ selectedItem ] ),
Expand Down

0 comments on commit 4bc5fe1

Please sign in to comment.