Skip to content

Commit f809753

Browse files
committed
Apply fix to wkh237#302 IOS fs.df issue
1 parent 3a87c83 commit f809753

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ios/RNFetchBlobFS.m

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -748,20 +748,17 @@ + (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * pa
748748

749749
+(void) df:(RCTResponseSenderBlock)callback
750750
{
751-
uint64_t totalSpace = 0;
752-
uint64_t totalFreeSpace = 0;
753751
NSError *error = nil;
754752
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
755753
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
756754

757755
if (dictionary) {
758756
NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
759757
NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
760-
totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
761-
totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
758+
762759
callback(@[[NSNull null], @{
763-
@"free" : [NSNumber numberWithUnsignedLongLong: totalFreeSpace],
764-
@"total" : [NSNumber numberWithUnsignedLongLong: totalSpace],
760+
@"free" : freeFileSystemSizeInBytes,
761+
@"total" : fileSystemSizeInBytes,
765762
}]);
766763
} else {
767764
callback(@[@"failed to get storage usage."]);

0 commit comments

Comments
 (0)