Skip to content

Commit

Permalink
Merge pull request #20475 from wordpress-mobile/feature/prompts-card-…
Browse files Browse the repository at this point in the history
…pull-to-refresh

Refresh blogging prompt card on pull-to-refresh
  • Loading branch information
dvdchr authored Apr 5, 2023
2 parents b7500fa + ec46207 commit 1477c85
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
self.sitePickerViewController?.blogDetailHeaderView.blog = blog
self.blogDashboardViewController?.reloadCardsLocally()
}

/// Update today's prompt if the blog has blogging prompts enabled.
fetchPrompt(for: blog)
}

WPAnalytics.track(.mySitePullToRefresh, properties: [WPAppAnalyticsKeyTabSource: section.analyticsDescription])
Expand Down Expand Up @@ -961,7 +964,13 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
guard FeatureFlag.bloggingPrompts.enabled,
let blog = blog,
blog.isAccessibleThroughWPCom(),
let promptsService = BloggingPromptsService(blog: blog) else {
let promptsService = BloggingPromptsService(blog: blog),
let siteID = blog.dotComID?.intValue else {
return
}

let dashboardPersonalization = BlogDashboardPersonalizationService(siteID: siteID)
guard dashboardPersonalization.isEnabled(.prompts) else {
return
}

Expand Down

0 comments on commit 1477c85

Please sign in to comment.