Просмотр исходного кода

fix nextcloud open-file

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 лет назад
Родитель
Сommit
43890f9739
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      iOSClient/AppDelegate.swift

+ 3 - 4
iOSClient/AppDelegate.swift

@@ -868,14 +868,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                 if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
 
                     let urlBase = URL(string: activeAccount.urlBase)
-                    let user = activeAccount.user
-                    if linkScheme.contains(urlBase?.host ?? "") && userScheme == user {
+                    if linkScheme.contains(urlBase?.host ?? "") && userScheme == activeAccount.userId {
                         matchedAccount = activeAccount
                     } else {
                         let accounts = NCManageDatabase.shared.getAllAccount()
                         for account in accounts {
-                            guard let accountURL = URL(string: account.urlBase) else { return false }
-                            if linkScheme.contains(accountURL.host ?? "") && userScheme == account.user {
+                            let urlBase = URL(string: account.urlBase)
+                            if linkScheme.contains(urlBase?.host ?? "") && userScheme == account.userId {
                                 changeAccount(account.account)
                                 matchedAccount = account
                                 break