Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 895563c

Browse files
committed
Update according to code review
- updated function name - updated message in pop up
1 parent d07dddb commit 895563c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

WordPressAuthenticator/Authenticator/WordPressAuthenticatorDelegateProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public protocol WordPressAuthenticatorDelegate: class {
2020
///
2121
var supportEnabled: Bool { get }
2222

23-
/// Returns true if there is a default WordPress.com account in the app./
24-
var defaultWordPressComAccountExists: Bool { get }
23+
/// Returns true if there isn't a default WordPress.com account connected in the app.
24+
var allowWPComLogin: Bool { get }
2525

2626
/// Signals the Host App that a new WordPress.com account has just been created.
2727
///

WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
187187
let service = WordPressComBlogService()
188188
service.fetchSiteInfo(for: siteAddress, success: { [weak self] siteInfo in
189189
self?.loginFields.meta.siteInfo = siteInfo
190-
if WordPressAuthenticator.shared.delegate?.defaultWordPressComAccountExists == true {
190+
if WordPressAuthenticator.shared.delegate?.allowWPComLogin == false {
191191
self?.promptUserToLogoutBeforeConnectingWPComSite()
192192
self?.configureViewLoading(false)
193193
} else {
@@ -235,7 +235,7 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
235235

236236
@objc private func promptUserToLogoutBeforeConnectingWPComSite() {
237237
let acceptActionTitle = NSLocalizedString("OK", comment: "Alert dismissal title")
238-
let message = NSLocalizedString("Please logout before connecting to a different wordpress.com site", comment: "Message for alert to prompt user to logout before connecting to a different wxordpress.com site")
238+
let message = NSLocalizedString("Please log out before connecting to a different wordpress.com site", comment: "Message for alert to prompt user to logout before connecting to a different wordpress.com site.")
239239
let alertController = UIAlertController(title: nil, message: message, preferredStyle: .alert)
240240
alertController.addDefaultActionWithTitle(acceptActionTitle)
241241
present(alertController, animated: true)

0 commit comments

Comments
 (0)