Skip to content

Commit b38bd88

Browse files
authored
Fix a bug that was causing the log out not to work when in the migration flow (#19696)
1 parent 6e73a33 commit b38bd88

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WordPress/Classes/ViewRelated/Support/LogOutActionHandler.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ import UIKit
22

33
struct LogOutActionHandler {
44

5+
private weak var windowManager: WindowManager?
6+
7+
init(windowManager: WindowManager? = WordPressAppDelegate.shared?.windowManager) {
8+
self.windowManager = windowManager
9+
}
10+
511
func logOut(with viewController: UIViewController) {
612
let alert = UIAlertController(title: logOutAlertTitle, message: nil, preferredStyle: .alert)
713
alert.addActionWithTitle(Strings.alertCancelAction, style: .cancel)
814
alert.addActionWithTitle(Strings.alertLogoutAction, style: .destructive) { [weak viewController] _ in
915
viewController?.dismiss(animated: true) {
1016
AccountHelper.logOutDefaultWordPressComAccount()
17+
windowManager?.showSignInUI()
1118
}
1219
}
1320
viewController.present(alert, animated: true)

0 commit comments

Comments
 (0)