|
@@ -119,8 +119,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
// Activate user account
|
|
|
if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
|
|
|
|
|
|
- settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
|
|
|
+ settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account), initialize: false)
|
|
|
NCBrandColor.shared.settingThemingColor(account: activeAccount.account)
|
|
|
+ initialize()
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -588,7 +589,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: - Account
|
|
|
|
|
|
- @objc func settingAccount(_ account: String, urlBase: String, user: String, userId: String, password: String) {
|
|
|
+ @objc func settingAccount(_ account: String, urlBase: String, user: String, userId: String, password: String, initialize: Bool = true) {
|
|
|
|
|
|
let accountTestBackup = self.account + "/" + self.userId
|
|
|
let accountTest = account + "/" + userId
|
|
@@ -609,7 +610,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
|
|
|
DispatchQueue.main.async {
|
|
|
- if UIApplication.shared.applicationState != .background && accountTestBackup != accountTest {
|
|
|
+ if initialize, UIApplication.shared.applicationState != .background && accountTestBackup != accountTest {
|
|
|
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize, second: 0.2)
|
|
|
}
|
|
|
}
|