Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Milen Pivchev <[email protected]>
  • Loading branch information
mpivchev committed May 30, 2024
1 parent 8de1a2d commit 7d9ab9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
activeLogin?.urlBase = NCBrandOptions.shared.loginBaseUrl
showLoginViewController(activeLogin)
}
} else if openLoginWeb {
} else if openLoginWeb { // remove this, create a bool for no accounts
// Used also for reinsert the account (change passwd)
if activeLogin?.view.window == nil {
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
activeLogin?.urlBase = urlBase
activeLogin?.disableUrlField = true
activeLogin?.disableCloseButton = true
// activeLogin?.user = user
showLoginViewController(activeLogin)
}
} else {
if activeLogin?.view.window == nil {
activeLogin?.disableCloseButton = true

activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
showLoginViewController(activeLogin)
}
Expand Down
3 changes: 2 additions & 1 deletion iOSClient/Login/NCLogin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
/// The URL that will show up on the URL field when this screen appears
var urlBase = ""
var disableUrlField = false
var disableCloseButton = false

// Used for MDM
var configServerUrl: String?
Expand Down Expand Up @@ -125,7 +126,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
self.navigationController?.navigationBar.tintColor = textColor

if !NCManageDatabase.shared.getAllAccount().isEmpty {
if !NCManageDatabase.shared.getAllAccount().isEmpty && !disableCloseButton {
let navigationItemCancel = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(self.actionCancel))
navigationItemCancel.tintColor = textColor
navigationItem.leftBarButtonItem = navigationItemCancel
Expand Down

0 comments on commit 7d9ab9f

Please sign in to comment.