Skip to content

Commit

Permalink
Merge pull request wordpress-mobile#21069 from wordpress-mobile/task/…
Browse files Browse the repository at this point in the history
…21058-compliance-popup-wordpress

[EU/US Compliance] Show popover for EU users in WordPress
  • Loading branch information
hassaanelgarem authored Jul 12, 2023
2 parents 43c933b + f668fce commit c815bfd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ final class BlogDashboardViewController: UIViewController {
BlogDashboardViewModel(viewController: self, blog: blog)
}()

private var complianceCoordinator: CompliancePopoverCoordinator?

lazy var collectionView: DynamicHeightCollectionView = {
let collectionView = DynamicHeightCollectionView(frame: .zero, collectionViewLayout: createLayout())
Expand Down Expand Up @@ -81,9 +80,6 @@ final class BlogDashboardViewController: UIViewController {
startAlertTimer()

WPAnalytics.track(.mySiteDashboardShown)

complianceCoordinator = CompliancePopoverCoordinator(viewController: self)
complianceCoordinator?.presentIfNeeded()
}

override func viewWillDisappear(_ animated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
var willDisplayPostSignupFlow: Bool = false

private var createButtonCoordinator: CreateButtonCoordinator?
private var complianceCoordinator: CompliancePopoverCoordinator?

private let meScenePresenter: ScenePresenter
private let blogService: BlogService
Expand Down Expand Up @@ -208,6 +209,9 @@ class MySiteViewController: UIViewController, NoResultsViewHost {

createFABIfNeeded()
fetchPrompt(for: blog)

complianceCoordinator = CompliancePopoverCoordinator(viewController: self)
complianceCoordinator?.presentIfNeeded()
}

override func viewDidLayoutSubviews() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class CompliancePopoverCoordinator: CompliancePopoverCoordinatorProtocol {
}

func presentIfNeeded() {
guard FeatureFlag.compliancePopover.enabled else {
guard FeatureFlag.compliancePopover.enabled, !defaults.didShowCompliancePopup else {
return
}
complianceService.getIPCountryCode { [weak self] result in
Expand Down

0 comments on commit c815bfd

Please sign in to comment.