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

Commit 3d12cc9

Browse files
committed
Add close button to site credential controller
1 parent ad6811f commit 3d12cc9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

WordPressAuthenticator/Authenticator/WordPressAuthenticator.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ import WordPressKit
242242
let loginFields = LoginFields()
243243
loginFields.siteAddress = siteURL
244244
controller.loginFields = loginFields
245-
controller.dismissBlock = { _ in
246-
controller.navigationController?.dismiss(animated: true)
247-
}
248245

249246
let navController = LoginNavigationController(rootViewController: controller)
250247
navController.modalPresentationStyle = .fullScreen

WordPressAuthenticator/Unified Auth/View Related/Site Address/SiteCredentialsViewController.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ final class SiteCredentialsViewController: LoginViewController {
5858
loginFields.meta.userIsDotCom = false
5959

6060
navigationItem.title = WordPressAuthenticator.shared.displayStrings.logInTitle
61+
if completionHandler != nil {
62+
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(dismissView))
63+
}
6164
styleNavigationBar(forUnified: true)
6265

6366
// Store default margin, and size table for the view.
@@ -233,6 +236,9 @@ extension SiteCredentialsViewController: UITextFieldDelegate {
233236
// MARK: - Private Methods
234237
private extension SiteCredentialsViewController {
235238

239+
@objc func dismissView() {
240+
navigationController?.dismiss(animated: true)
241+
}
236242
/// Registers all of the available TableViewCells.
237243
///
238244
func registerTableViewCells() {

0 commit comments

Comments
 (0)