Skip to content

Commit 3167d37

Browse files
author
Jon Petersson
committed
Fix welcome screen not shown on account creation
1 parent ef86758 commit 3167d37

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

ios/MullvadVPN/Coordinators/LoginCoordinator.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ final class LoginCoordinator: Coordinator, Presenting, DeviceManagementViewContr
4949
self?.didFinishLogin(action: action, error: error) ?? .nothing
5050
}
5151

52+
loginController.didCreateAccount = didCreateAccount
53+
5254
preferredAccountNumberPublisher?
5355
.compactMap { $0 }
5456
.sink(receiveValue: { preferredAccountNumber in
5557
interactor.suggestPreferredAccountNumber?(preferredAccountNumber)
5658
})
5759
.store(in: &subscriptions)
5860

59-
interactor.didCreateAccount = self.didCreateAccount
60-
6161
navigationController.pushViewController(loginController, animated: animated)
6262

6363
self.loginController = loginController

ios/MullvadVPN/View controllers/Login/LoginInteractor.swift

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ final class LoginInteractor {
1414
private let tunnelManager: TunnelManager
1515
private let logger = Logger(label: "LoginInteractor")
1616
private var tunnelObserver: TunnelObserver?
17-
var didCreateAccount: (() -> Void)?
1817
var suggestPreferredAccountNumber: ((String) -> Void)?
1918

2019
init(tunnelManager: TunnelManager) {

ios/MullvadVPN/View controllers/Login/LoginViewController.swift

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class LoginViewController: UIViewController, RootContainment {
9898
private let interactor: LoginInteractor
9999

100100
var didFinishLogin: ((LoginAction, Error?) -> EndLoginAction)?
101+
var didCreateAccount: (() -> Void)?
101102

102103
override var preferredStatusBarStyle: UIStatusBarStyle {
103104
.lightContent
@@ -199,6 +200,7 @@ class LoginViewController: UIViewController, RootContainment {
199200
switch action {
200201
case .createAccount:
201202
self.contentView.accountInputGroup.setAccount(try await interactor.createAccount())
203+
self.didCreateAccount?()
202204

203205
case let .useExistingAccount(accountNumber):
204206
try await interactor.setAccount(accountNumber: accountNumber)

0 commit comments

Comments
 (0)