瀏覽代碼

Apply fix to #302 IOS fs.df issue

Ben Hsieh 7 年之前
父節點
當前提交
623afc3ec7
共有 1 個檔案被更改,包括 3 行新增6 行删除
  1. 3
    6
      ios/RNFetchBlobFS.m

+ 3
- 6
ios/RNFetchBlobFS.m 查看文件

@@ -758,8 +758,6 @@ NSMutableDictionary *fileStreams = nil;
758 758
 
759 759
 +(void) df:(RCTResponseSenderBlock)callback
760 760
 {
761
-    uint64_t totalSpace = 0;
762
-    uint64_t totalFreeSpace = 0;
763 761
     NSError *error = nil;
764 762
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
765 763
     NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
@@ -767,11 +765,10 @@ NSMutableDictionary *fileStreams = nil;
767 765
     if (dictionary) {
768 766
         NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
769 767
         NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
770
-        totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
771
-        totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
768
+        
772 769
         callback(@[[NSNull null], @{
773
-                  @"free" : [NSNumber numberWithUnsignedLongLong: totalFreeSpace],
774
-                  @"total" : [NSNumber numberWithUnsignedLongLong: totalSpace],
770
+                  @"free" : freeFileSystemSizeInBytes,
771
+                  @"total" : fileSystemSizeInBytes,
775 772
                 }]);
776 773
     } else {
777 774
         callback(@[@"failed to get storage usage."]);