Skip to content

Commit 6197b2b

Browse files
committed
Disable Story posts when Jetpack features are removed
1 parent 5787bbf commit 6197b2b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

WordPress/Classes/Models/Blog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
1515
@class UserSuggestion;
1616
@class SiteSuggestion;
1717
@class PageTemplateCategory;
18+
@class JetpackFeaturesRemovalCoordinator;
1819

1920
extern NSString * const BlogEntityName;
2021
extern NSString * const PostFormatStandard;

WordPress/Classes/Models/Blog.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,8 @@ - (BOOL)supportsPluginManagement
691691
- (BOOL)supportsStories
692692
{
693693
BOOL hasRequiredJetpack = [self hasRequiredJetpackVersion:@"9.1"];
694-
return hasRequiredJetpack || self.isHostedAtWPcom;
694+
// Stories are disabled in iPad until this Kanvas issue is solved: https://github.com/tumblr/kanvas-ios/issues/104
695+
return (hasRequiredJetpack || self.isHostedAtWPcom) && ![UIDevice isPad] && ![JetpackFeaturesRemovalCoordinator shouldRemoveJetpackFeatures];
695696
}
696697

697698
- (BOOL)supportsContactInfo

WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController+FAB.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension MySiteViewController {
2828

2929
var actions: [ActionSheetItem] = []
3030

31-
if shouldShowNewStory {
31+
if blog?.supports(.stories) ?? false {
3232
actions.append(StoryAction(handler: newStory, source: source))
3333
}
3434

@@ -38,8 +38,4 @@ extension MySiteViewController {
3838
let coordinator = CreateButtonCoordinator(self, actions: actions, source: source, blog: blog)
3939
return coordinator
4040
}
41-
42-
private var shouldShowNewStory: Bool {
43-
return (blog?.supports(.stories) ?? false) && !UIDevice.isPad()
44-
}
4541
}

0 commit comments

Comments
 (0)