@@ -599,7 +599,7 @@ - (NSIndexPath *)restorableSelectedIndexPath
599599{
600600 if (!_restorableSelectedIndexPath) {
601601 // If nil, default to stats subsection.
602- BlogDetailsSubsection subsection = [self shouldShowDashboard ] ? BlogDetailsSubsectionHome : BlogDetailsSubsectionStats ;
602+ BlogDetailsSubsection subsection = [self defaultSubsection ] ;
603603 self.selectedSectionCategory = [self sectionCategoryWithSubsection: subsection blog: self .blog];
604604 NSUInteger section = [self findSectionIndexWithSections: self .tableSections category: self .selectedSectionCategory];
605605 _restorableSelectedIndexPath = [NSIndexPath indexPathForRow: 0 inSection: section];
@@ -703,7 +703,7 @@ - (void)reloadTableViewPreservingSelection
703703 case BlogDetailsSectionCategoryQuickStart:
704704 case BlogDetailsSectionCategoryJetpackBrandingCard:
705705 case BlogDetailsSectionCategoryDomainCredit: {
706- BlogDetailsSubsection subsection = [self shouldShowDashboard ] ? BlogDetailsSubsectionHome : BlogDetailsSubsectionStats ;
706+ BlogDetailsSubsection subsection = [self defaultSubsection ] ;
707707 BlogDetailsSectionCategory category = [self sectionCategoryWithSubsection: subsection blog: self .blog];
708708 sectionIndex = [self findSectionIndexWithSections: self .tableSections category: category];
709709 }
@@ -738,9 +738,6 @@ - (void)configureTableViewData
738738{
739739 NSMutableArray *marr = [NSMutableArray array ];
740740
741- if (AppConfiguration.showsQuickActions && ![self isDashboardEnabled ]) {
742- [marr addObject: [self quickActionsSectionViewModel ]];
743- }
744741 if (MigrationSuccessCardView.shouldShowMigrationSuccessCard == YES ) {
745742 [marr addObject: [self migrationSuccessSectionViewModel ]];
746743 }
@@ -761,16 +758,20 @@ - (void)configureTableViewData
761758 if ([self isDashboardEnabled ] && ![self splitViewControllerIsHorizontallyCompact ]) {
762759 [marr addObject: [self homeSectionViewModel ]];
763760 }
764- if (self. blog . shouldShowJetpackSection ) {
761+ if ([ self shouldAddJetpackSection ] ) {
765762 [marr addObject: [self jetpackSectionViewModel ]];
766- } else {
763+ }
764+
765+ if ([self shouldAddGeneralSection ]) {
767766 [marr addObject: [self generalSectionViewModel ]];
768767 }
769768
770769 [marr addObject: [self publishTypeSectionViewModel ]];
771- if ([self .blog supports: BlogFeatureThemeBrowsing] || [self .blog supports: BlogFeatureMenus]) {
770+
771+ if ([self shouldAddPersonalizeSection ]) {
772772 [marr addObject: [self personalizeSectionViewModel ]];
773773 }
774+
774775 [marr addObject: [self configurationSectionViewModel ]];
775776 [marr addObject: [self externalSectionViewModel ]];
776777 if ([self .blog supports: BlogFeatureRemovable]) {
@@ -969,7 +970,7 @@ - (BlogDetailsSection *)configurationSectionViewModel
969970 __weak __typeof (self) weakSelf = self;
970971 NSMutableArray *rows = [NSMutableArray array ];
971972
972- if ([self .blog supports: BlogFeatureSharing ]) {
973+ if ([self shouldAddSharingRow ]) {
973974 BlogDetailsRow *row = [[BlogDetailsRow alloc ] initWithTitle: NSLocalizedString(@" Sharing" , @" Noun. Title. Links to a blog's sharing options." )
974975 image: [UIImage gridiconOfType: GridiconTypeShare]
975976 callback: ^{
@@ -979,15 +980,15 @@ - (BlogDetailsSection *)configurationSectionViewModel
979980 [rows addObject: row];
980981 }
981982
982- if ([self .blog supports: BlogFeaturePeople ]) {
983+ if ([self shouldAddPeopleRow ]) {
983984 [rows addObject: [[BlogDetailsRow alloc ] initWithTitle: NSLocalizedString(@" People" , @" Noun. Title. Links to the people management feature." )
984985 image: [UIImage gridiconOfType: GridiconTypeUser]
985986 callback: ^{
986987 [weakSelf showPeople ];
987988 }]];
988989 }
989990
990- if ([self .blog supports: BlogFeaturePluginManagement ]) {
991+ if ([self shouldAddPluginsRow ]) {
991992 [rows addObject: [[BlogDetailsRow alloc ] initWithTitle: NSLocalizedString(@" Plugins" , @" Noun. Title. Links to the plugin management feature." )
992993 image: [UIImage gridiconOfType: GridiconTypePlugins]
993994 callback: ^{
@@ -1005,7 +1006,7 @@ - (BlogDetailsSection *)configurationSectionViewModel
10051006
10061007 [rows addObject: row];
10071008
1008- if ([self shouldShowDomainRegistration ]) {
1009+ if ([self shouldAddDomainRegistrationRow ]) {
10091010 BlogDetailsRow *domainsRow = [[BlogDetailsRow alloc ] initWithTitle: NSLocalizedString(@" Domains" , @" Noun. Title. Links to the Domains screen." )
10101011 identifier: BlogDetailsSettingsCellIdentifier
10111012 accessibilityIdentifier: @" Domains Row"
@@ -1112,11 +1113,19 @@ - (void)showInitialDetailsForBlog
11121113
11131114 WPSplitViewController *splitViewController = (WPSplitViewController *)self.splitViewController ;
11141115 splitViewController.isShowingInitialDetail = YES ;
1115-
1116- if ([self shouldShowDashboard ]) {
1117- [self showDetailViewForSubsection: BlogDetailsSubsectionHome];
1118- } else {
1119- [self showDetailViewForSubsection: BlogDetailsSubsectionStats];
1116+ BlogDetailsSubsection subsection = [self defaultSubsection ];
1117+ switch (subsection) {
1118+ case BlogDetailsSubsectionHome:
1119+ [self showDetailViewForSubsection: BlogDetailsSubsectionHome];
1120+ break ;
1121+ case BlogDetailsSubsectionStats:
1122+ [self showDetailViewForSubsection: BlogDetailsSubsectionStats];
1123+ break ;
1124+ case BlogDetailsSubsectionPosts:
1125+ [self showDetailViewForSubsection: BlogDetailsSubsectionPosts];
1126+ break ;
1127+ default :
1128+ break ;
11201129 }
11211130}
11221131
@@ -1399,7 +1408,7 @@ - (void)preloadMetadata
13991408
14001409- (void )preloadDomains
14011410{
1402- if (![self shouldShowDomainRegistration ]) {
1411+ if (![self shouldAddDomainRegistrationRow ]) {
14031412 return ;
14041413 }
14051414
@@ -1408,13 +1417,6 @@ - (void)preloadDomains
14081417 failure: nil ];
14091418}
14101419
1411- - (BOOL )shouldShowDomainRegistration
1412- {
1413- return [Feature enabled: FeatureFlagDomains]
1414- && [AppConfiguration allowsDomainRegistration ]
1415- && [self .blog supports: BlogFeatureDomains];
1416- }
1417-
14181420- (void )scrollToElement : (QuickStartTourElement) element
14191421{
14201422 int sectionCount = 0 ;
@@ -1750,10 +1752,15 @@ - (void)handleDataModelChange:(NSNotification *)note
17501752
17511753- (UIViewController *)initialDetailViewControllerForSplitView : (WPSplitViewController *)splitView
17521754{
1753- StatsViewController *statsView = [StatsViewController new ];
1754- statsView.blog = self.blog ;
1755-
1756- return statsView;
1755+ if ([self shouldShowStats ]) {
1756+ StatsViewController *statsView = [StatsViewController new ];
1757+ statsView.blog = self.blog ;
1758+ return statsView;
1759+ } else {
1760+ PostListViewController *postsView = [PostListViewController controllerWithBlog: self .blog];
1761+ postsView.navigationItem .largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeNever;
1762+ return postsView;
1763+ }
17571764}
17581765
17591766#pragma mark - UIViewControllerTransitioningDelegate
0 commit comments