Skip to content

Commit

Permalink
Remove conditional checks for Subscribers tab
Browse files Browse the repository at this point in the history
  • Loading branch information
a8ck3n committed Jan 15, 2025
1 parent 7e59ffa commit c903827
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions client/blocks/stats-navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@ import { useNoticeVisibilityQuery } from 'calypso/my-sites/stats/hooks/use-notic
import { shouldGateStats } from 'calypso/my-sites/stats/hooks/use-should-gate-stats';
import { canCurrentUser } from 'calypso/state/selectors/can-current-user';
import isGoogleMyBusinessLocationConnectedSelector from 'calypso/state/selectors/is-google-my-business-location-connected';
import isJetpackModuleActive from 'calypso/state/selectors/is-jetpack-module-active';
import isSiteStore from 'calypso/state/selectors/is-site-store';
import siteHasFeature from 'calypso/state/selectors/site-has-feature';
import {
getJetpackStatsAdminVersion,
getSiteOption,
isJetpackSite,
isSimpleSite,
} from 'calypso/state/sites/selectors';
import { getJetpackStatsAdminVersion, getSiteOption } from 'calypso/state/sites/selectors';
import getSiteAdminUrl from 'calypso/state/sites/selectors/get-site-admin-url';
import {
updateModuleToggles,
Expand Down Expand Up @@ -142,15 +136,7 @@ class StatsNavigation extends Component {
};

isValidItem = ( item ) => {
const {
isGoogleMyBusinessLocationConnected,
isStore,
isWordAds,
isSubscriptionsModuleActive,
isSimple,
isSiteJetpackNotAtomic,
siteId,
} = this.props;
const { isGoogleMyBusinessLocationConnected, isStore, isWordAds, siteId } = this.props;

switch ( item ) {
case 'wordads':
Expand All @@ -171,11 +157,6 @@ class StatsNavigation extends Component {
return false;
}

// 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 @@ -317,9 +298,6 @@ export default connect(
isWordAds:
getSiteOption( state, siteId, 'wordads' ) &&
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 c903827

Please sign in to comment.