Browse Source

improve code

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
d486927b37
1 changed files with 2 additions and 5 deletions
  1. 2 5
      iOSClient/Login/NCLogin.swift

+ 2 - 5
iOSClient/Login/NCLogin.swift

@@ -41,6 +41,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
     private var textColorOpponent: UIColor = .black
     private var activeTextfieldDiff: CGFloat = 0
     private var activeTextField = UITextField()
+
     private var talkAccounts: [NKDataAccountFile]?
 
     // MARK: - View Life Cycle
@@ -108,11 +109,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
         self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
         self.navigationController?.navigationBar.tintColor = textColor
 
-        if NCManageDatabase.shared.getAccounts()?.count ?? 0 == 0 {
-
-        } else {
-
-            // Cancel Button
+        if !NCManageDatabase.shared.getAllAccount().isEmpty {
             let navigationItemCancel = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(self.actionCancel))
             navigationItemCancel.tintColor = textColor
             navigationItem.leftBarButtonItem = navigationItemCancel