Skip to content

Commit

Permalink
Update MigrateLocalStorage.m
Browse files Browse the repository at this point in the history
  • Loading branch information
daikeung authored Jun 10, 2019
1 parent b8269c7 commit c7b5f6a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ios/MigrateLocalStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ - (void) migrateLocalStorage
[self copyFrom:[original stringByAppendingString:@"-shm"] to:[target stringByAppendingString:@"-shm"]];
[self copyFrom:[original stringByAppendingString:@"-wal"] to:[target stringByAppendingString:@"-wal"]];
}

// for using hostname in config.xml, local storage path changed
NSString* target2 = [appLibraryFolder stringByAppendingPathComponent:@"WebKit/WebsiteData/LocalStorage/httpsionic_app.topo.cc_0.localstorage"];
// Only copy data if no existing localstorage data exists yet for hostname
if (![[NSFileManager defaultManager] fileExistsAtPath:target2]) {
NSLog(@"No existing localstorage data found for hostname. Migrating data from normal wkwebview");
[self copyFrom:target to:target2];
[self copyFrom:[target stringByAppendingString:@"-shm"] to:[target2 stringByAppendingString:@"-shm"]];
[self copyFrom:[target stringByAppendingString:@"-wal"] to:[target2 stringByAppendingString:@"-wal"]];
}
}

- (void)pluginInitialize
Expand Down

0 comments on commit c7b5f6a

Please sign in to comment.