Skip to content

Commit

Permalink
Update when to store already open after db 23. Update with a better n…
Browse files Browse the repository at this point in the history
…ame.
  • Loading branch information
nasli committed Jan 22, 2018
1 parent 7115cb9 commit 2ecc2c3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Owncloud iOs Client/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
int currentDBVersion = [ManageDB getDatabaseVersion];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger migratedCredInDB23 = [defaults integerForKey:@"migratedCredInDB23"];
NSInteger openAfterUpgradeDB23 = [defaults integerForKey:@"openAfterUpgradeDB23"];

if (currentDBVersion == 23 && migratedCredInDB23 != 1){
if (currentDBVersion == 23 && openAfterUpgradeDB23 != 1){
NSLog(@"Migrating after first open upgrade, Change kind of credentials in DB version from 21or22 to23");
sleep(3);
bool migrated = [OCKeychain updateAllKeychainItemsFromDBVersion21or22To23ToStoreCredentialsDtoAsValueAndAuthenticationType];
Expand All @@ -196,10 +196,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
NSLog(@"No migrated credentials at init");
} else {
NSLog(@"Migrated credentials at init");
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:1 forKey:@"migratedCredInDB23"];
[defaults synchronize];
}
//Some users could have migrated correctly from 3.6.2 to 3.7.0.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:1 forKey:@"openAfterUpgradeDB23"];
[defaults synchronize];
}

ManageAccounts *manageAccounts = [ManageAccounts new];
Expand Down

0 comments on commit 2ecc2c3

Please sign in to comment.