Skip to content

Commit

Permalink
Merge pull request #1048 from SilviuOdobescu/master
Browse files Browse the repository at this point in the history
IOS-1248: Disable sync content migration
  • Loading branch information
SilviuOdobescu authored Mar 21, 2019
2 parents c44c4fc + 71e034c commit ea6f1c7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions AlfrescoApp/Model/Managers/RealmSyncCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ - (RLMRealmConfiguration *)configForName:(NSString *)name
if(name.length)
{
NSString *configFilePath = nil;
BOOL isContentMigrationNeeded = [self isContentMigrationNeeded];

if (isContentMigrationNeeded)
if ([self hasContentMigrationOccured])
{
// Use the default directory, but replace the filename with the accountId
configFilePath = [[[config.fileURL.path stringByDeletingLastPathComponent] stringByAppendingPathComponent:name] stringByAppendingPathExtension:@"realm"];
Expand Down Expand Up @@ -400,6 +399,12 @@ - (BOOL)isContentMigrationNeeded
return isMigrationNeededResult;
}

- (BOOL)hasContentMigrationOccured
{
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:kAlfrescoMobileGroup];
return [defaults boolForKey:kHasSyncedContentMigrationOccurred];
}

- (void)initiateContentMigrationProcessForAccounts:(NSArray *)accounts
{
void (^saveContentMigrationOccured)(void) = ^()
Expand Down

0 comments on commit ea6f1c7

Please sign in to comment.