|
@@ -116,9 +116,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // init home
|
|
|
- NotificationCenter.default.addObserver(self, selector: #selector(initializeMain), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitializeMain), object: nil)
|
|
|
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
|
|
|
+ // initialize
|
|
|
+ NotificationCenter.default.addObserver(self, selector: #selector(initialize), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
|
|
|
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
|
|
|
|
|
|
// Process upload
|
|
|
networkingProcessUpload = NCNetworkingProcessUpload.init()
|
|
@@ -204,7 +204,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
if activeAccount.account != account {
|
|
|
settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
|
|
|
|
|
|
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
|
|
|
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
|
|
|
}
|
|
|
|
|
|
NCCommunicationCommon.shared.writeLog("Application will enter in foreground")
|
|
@@ -274,7 +274,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: -
|
|
|
|
|
|
- @objc func initializeMain() {
|
|
|
+ @objc func initialize() {
|
|
|
|
|
|
if account == "" { return }
|
|
|
|
|
@@ -598,7 +598,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
if let newAccount = accounts?.first {
|
|
|
if let account = NCManageDatabase.shared.setAccountActive(newAccount) {
|
|
|
settingAccount(account.account, urlBase: account.urlBase, user: account.user, userId: account.userId, password: CCUtility.getPassword(account.account))
|
|
|
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
|
|
|
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -617,7 +617,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
|
|
|
|
|
|
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
|
|
|
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -778,7 +778,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
NCManageDatabase.shared.setAccountActive(account.account)
|
|
|
settingAccount(account.account, urlBase: account.urlBase, user: account.user, userId: account.userId, password: CCUtility.getPassword(account.account))
|
|
|
matchedAccount = account
|
|
|
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitializeMain)
|
|
|
+ NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
|
|
|
break
|
|
|
}
|
|
|
}
|