mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-11 17:24:27 +00:00
fix #990
This commit is contained in:
parent
baebbef6f8
commit
d272bf05a5
@ -139,17 +139,21 @@ RCT_EXPORT_METHOD(startNode:(RCTResponseSenderBlock)onResultCallback) {
|
||||
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:folderName.path])
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:folderName.path withIntermediateDirectories:NO attributes:nil error:&error];
|
||||
NSURL *flagFileUrl = [folderName URLByAppendingPathComponent:@"ropsten_flag"];
|
||||
NSURL *flagFolderUrl = [[[[NSFileManager defaultManager]
|
||||
URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask]
|
||||
lastObject]
|
||||
URLByAppendingPathComponent:@"ropsten_flag"];
|
||||
|
||||
if(![[NSFileManager defaultManager] fileExistsAtPath:flagFileUrl.path]){
|
||||
if(![[NSFileManager defaultManager] fileExistsAtPath:flagFolderUrl.path]){
|
||||
NSURL *lightChainData = [folderName URLByAppendingPathComponent:@"StatusIM/lightchaindata"];
|
||||
[[NSFileManager defaultManager] removeItemAtPath:lightChainData.path
|
||||
error:nil];
|
||||
NSString *content = @"";
|
||||
NSData *fileContents = [content dataUsingEncoding:NSUTF8StringEncoding];
|
||||
[[NSFileManager defaultManager] createFileAtPath:flagFileUrl.path
|
||||
contents:fileContents
|
||||
attributes:nil];
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:flagFolderUrl.path
|
||||
withIntermediateDirectories:NO
|
||||
attributes:nil
|
||||
error:&error];
|
||||
}
|
||||
|
||||
if (error){
|
||||
|
Loading…
x
Reference in New Issue
Block a user