Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/21.3' into task/disable-…
Browse files Browse the repository at this point in the history
…prevent-notifications
  • Loading branch information
twstokes committed Dec 6, 2022
2 parents ac5fc43 + a4de7fe commit a325d3d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
1 change: 0 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

21.3
-----
* [***] Adds a smooth, opt-in transition to the Jetpack app. [#19714]
* [*] Fixed a minor UI issue where the segmented control under My SIte was being clipped when "Home" is selected. [#19595]
* [*] Fixed an issue where the site wasn't removed and the app wasn't refreshed after disconnecting the site from WordPress.com. [#19634]
* [*] [internal] Fixed an issue where Jetpack extensions were conflicting with WordPress extensions. [#19665]
Expand Down
10 changes: 6 additions & 4 deletions WordPress/Classes/System/WordPressAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,12 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {

setupWordPressExtensions()

// Start proactively exporting WP data in the background if the conditions are fulfilled.
// This needs to be called after `setupWordPressExtensions` because it updates the stored data.
DispatchQueue.global().async {
ContentMigrationCoordinator.shared.startOnceIfNeeded()
if FeatureFlag.contentMigration.enabled {
// Start proactively exporting WP data in the background if the conditions are fulfilled.
// This needs to be called after `setupWordPressExtensions` because it updates the stored data.
DispatchQueue.global().async {
ContentMigrationCoordinator.shared.startOnceIfNeeded()
}
}

shortcutCreator.createShortcutsIf3DTouchAvailable(AccountHelper.isLoggedIn)
Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
case .jetpackPowered:
return true
case .jetpackPoweredBottomSheet:
return true
return false
case .contentMigration:
return true
return false
case .newJetpackLandingScreen:
return true
case .newWordPressLandingScreen:
Expand Down
25 changes: 15 additions & 10 deletions WordPress/Jetpack/Classes/System/JetpackWindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@ class JetpackWindowManager: WindowManager {
}

override func showUI(for blog: Blog?) {
// If the user is logged in and has blogs sync'd to their account
if AccountHelper.isLoggedIn && AccountHelper.hasBlogs {
showAppUI(for: blog)
return
if AccountHelper.isLoggedIn {
if AccountHelper.hasBlogs {
// If the user is logged in and has blogs sync'd to their account
showAppUI(for: blog)
return
} else {
// If the user doesn't have any blogs, but they're still logged in, log them out
// the `logOutDefaultWordPressComAccount` method will trigger the `showSignInUI` automatically
AccountHelper.logOutDefaultWordPressComAccount()
return
}
}

guard AccountHelper.isLoggedIn else {
self.migrationTracker.trackContentImportEligibility(eligible: shouldImportMigrationData)
shouldImportMigrationData ? importAndShowMigrationContent(blog) : showSignInUI()
guard FeatureFlag.contentMigration.enabled else {
showSignInUI()
return
}

// If the user doesn't have any blogs, but they're still logged in, log them out
// the `logOutDefaultWordPressComAccount` method will trigger the `showSignInUI` automatically
AccountHelper.logOutDefaultWordPressComAccount()
self.migrationTracker.trackContentImportEligibility(eligible: shouldImportMigrationData)
shouldImportMigrationData ? importAndShowMigrationContent(blog) : showSignInUI()
}

func importAndShowMigrationContent(_ blog: Blog? = nil) {
Expand Down

0 comments on commit a325d3d

Please sign in to comment.