Skip to content

Commit 9986b95

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

3 files changed

Lines changed: 0 additions & 35 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 `presentLoginEpilogue` method.
6-
/// If this returns true, the `AuthenticationHandler.presentLoginEpilogue` 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 willHandlePresentLoginEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials) -> Bool
10-
11-
func presentLoginEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, windowManager: WindowManager, onDismiss: @escaping () -> Void) -> Bool
12-
135
/// Whether or not the AuthenticationHandler will override or handle the `presentSignupEpilogue` method.
146
/// If this returns true, the `AuthenticationHandler.presentSignupEpilogue` method is called
157
/// If not, then the default implementation will be called instead

WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,6 @@ extension WordPressAuthenticationManager: WordPressAuthenticatorDelegate {
317317
/// Presents the Login Epilogue, in the specified NavigationController.
318318
///
319319
func presentLoginEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, onDismiss: @escaping () -> Void) {
320-
if let authenticationHandler = authenticationHandler,
321-
authenticationHandler.willHandlePresentLoginEpilogue(in: navigationController, for: credentials),
322-
authenticationHandler.presentLoginEpilogue(in: navigationController, for: credentials, windowManager: windowManager, onDismiss: onDismiss) {
323-
return
324-
}
325320

326321
// If adding a self-hosted site, skip the Epilogue
327322
if let wporg = credentials.wporg,

WordPress/Jetpack/Classes/JetpackAuthenticationManager.swift

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

12-
func willHandlePresentLoginEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials) -> Bool {
13-
// Don't display the "no sites" epilogue if we allow site creation
14-
return !AppConfiguration.allowSiteCreation
15-
}
16-
17-
func presentLoginEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, windowManager: WindowManager, onDismiss: @escaping () -> Void) -> Bool {
18-
if AccountHelper.hasBlogs {
19-
return false
20-
}
21-
22-
// Exit out of the sign in process, if we don't do this we later can't
23-
// display the sign in again
24-
windowManager.dismissFullscreenSignIn()
25-
26-
// Display the no sites view
27-
let viewModel = JetpackNoSitesErrorViewModel()
28-
let controller = errorViewController(with: viewModel)
29-
windowManager.show(controller, completion: nil)
30-
31-
return true
32-
}
33-
3412
func willHandlePresentSignupEpilogue(in navigationController: UINavigationController, for credentials: AuthenticatorCredentials, service: SocialService?) -> Bool {
3513
// Don't display the "no sites" epilogue if we allow site creation
3614
return !AppConfiguration.allowSiteCreation

0 commit comments

Comments
 (0)