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

Commit fbda2ad

Browse files
committed
Clean & disconnect before connecting
1 parent b84bb36 commit fbda2ad

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)