Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 0b10cf1

Browse files
authored
Merge pull request #2525 from RocketChat/bug/auth_flow_connection.2515
[FIX] Fixed issue on connecting to a server & having an invalid server after all in some edge cases
2 parents 7d260a5 + fbda2ad commit 0b10cf1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Rocket.Chat/Controllers/Auth/ConnectServerViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ final class ConnectServerViewController: BaseViewController {
107107
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(hideKeyboard))
108108
view.addGestureRecognizer(tapGesture)
109109

110+
SocketManager.sharedInstance.socket?.disconnect()
111+
DatabaseManager.cleanInvalidDatabases()
112+
110113
if shouldAutoConnect {
111114
connect()
112115
}
@@ -115,9 +118,6 @@ final class ConnectServerViewController: BaseViewController {
115118
override func viewDidAppear(_ animated: Bool) {
116119
super.viewDidAppear(animated)
117120

118-
SocketManager.sharedInstance.socket?.disconnect()
119-
DatabaseManager.cleanInvalidDatabases()
120-
121121
if let applicationServerURL = AppManager.applicationServerURL {
122122
textFieldServerURL.isEnabled = false
123123
textFieldServerURL.text = applicationServerURL.host

0 commit comments

Comments
 (0)