Skip to content

Commit b1a8f12

Browse files
author
Momo Ozawa
committed
refactor: align presentSignupEpilogue behavior
Since the Jetpack app allows site creation, we don’t need to override presentSignupEpilogue anymore.
1 parent 9986b95 commit b1a8f12

3 files changed

Lines changed: 0 additions & 30 deletions

File tree

WordPress/Classes/Utility/App Configuration/AuthenticationHandler.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ import WordPressAuthenticator
22

33
protocol AuthenticationHandler {
44

5-
/// Whether or not the AuthenticationHandler will override or handle the `presentSignupEpilogue` method.
6-
/// If this returns true, the `AuthenticationHandler.presentSignupEpilogue` method is called
7-
/// If not, then the default implementation will be called instead
8-
/// - Returns: Bool, true if we should override the functionality, false if we should not
9-
func willHandlePresentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) -> Bool
10-
11-
func presentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?)
12-
135
// WPAuthenticator style overrides
146
var statusBarStyle: UIStatusBarStyle { get }
157
var prologueViewController: UIViewController? { get }

WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,6 @@ extension WordPressAuthenticationManager: WordPressAuthenticatorDelegate {
383383
/// Presents the Signup Epilogue, in the specified NavigationController.
384384
///
385385
func presentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) {
386-
if let authenticationHandler = authenticationHandler,
387-
authenticationHandler.willHandlePresentSignupEpilogue(in: navigationController, for: credentials, service: service) {
388-
authenticationHandler.presentSignupEpilogue(in: navigationController, for: credentials, service: service)
389-
return
390-
}
391386

392387
let storyboard = UIStoryboard(name: "SignupEpilogue", bundle: .main)
393388
guard let epilogueViewController = storyboard.instantiateInitialViewController() as? SignupEpilogueViewController else {

WordPress/Jetpack/Classes/JetpackAuthenticationManager.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,6 @@ struct JetpackAuthenticationManager: AuthenticationHandler {
99
var prologuePrimaryButtonStyle: NUXButtonStyle? = JetpackPrologueStyleGuide.continueButtonStyle
1010
var prologueSecondaryButtonStyle: NUXButtonStyle? = JetpackPrologueStyleGuide.siteAddressButtonStyle
1111

12-
func willHandlePresentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) -> Bool {
13-
// Don't display the "no sites" epilogue if we allow site creation
14-
return !AppConfiguration.allowSiteCreation
15-
}
16-
17-
// If the user signs up using the Jetpack app (through SIWA, for example)
18-
// We show right away the screen explaining that they do not have Jetpack sites
19-
func presentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) {
20-
let windowManager = WordPressAppDelegate.shared?.windowManager
21-
22-
windowManager?.dismissFullscreenSignIn()
23-
24-
let viewModel = JetpackNoSitesErrorViewModel()
25-
let controller = errorViewController(with: viewModel)
26-
windowManager?.show(controller, completion: nil)
27-
}
28-
2912
// MARK: - Private: Helpers
3013
private func isValidJetpack(for site: WordPressComSiteInfo) -> Bool {
3114
return site.hasJetpack &&

0 commit comments

Comments
 (0)