소스 검색

FIX 3.0.5 lost urlbase

marinofaggiana 4 년 전
부모
커밋
672d6b4c81
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      iOSClient/AppDelegate.m

+ 9 - 0
iOSClient/AppDelegate.m

@@ -87,6 +87,15 @@
         // remove all the App group key
         [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:[[NSBundle mainBundle] bundleIdentifier]];
     } else {
+        // FIX 3.0.5 lost urlbase
+        if (tableAccount.urlBase.length == 0) {
+            NSString *user = [tableAccount.user stringByAppendingString:@" "];
+            NSString *urlBase = [tableAccount.account stringByReplacingOccurrencesOfString:user withString:@""];
+            tableAccount.urlBase = urlBase;
+            [[NCManageDatabase sharedInstance] updateAccount:tableAccount];
+            
+            tableAccount = [[NCManageDatabase sharedInstance] getAccountActive];
+        }
         [self settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userID:tableAccount.userID password:[CCUtility getPassword:tableAccount.account]];
     }