ソースを参照

Apply fix to #302 IOS fs.df issue

Ben Hsieh 7 年 前
コミット
f8097532b5
共有1 個のファイルを変更した3 個の追加6 個の削除を含む
  1. 3
    6
      ios/RNFetchBlobFS.m

+ 3
- 6
ios/RNFetchBlobFS.m ファイルの表示

@@ -748,8 +748,6 @@ NSMutableDictionary *fileStreams = nil;
748 748
 
749 749
 +(void) df:(RCTResponseSenderBlock)callback
750 750
 {
751
-    uint64_t totalSpace = 0;
752
-    uint64_t totalFreeSpace = 0;
753 751
     NSError *error = nil;
754 752
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
755 753
     NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error: &error];
@@ -757,11 +755,10 @@ NSMutableDictionary *fileStreams = nil;
757 755
     if (dictionary) {
758 756
         NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
759 757
         NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
760
-        totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
761
-        totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
758
+        
762 759
         callback(@[[NSNull null], @{
763
-                  @"free" : [NSNumber numberWithUnsignedLongLong: totalFreeSpace],
764
-                  @"total" : [NSNumber numberWithUnsignedLongLong: totalSpace],
760
+                  @"free" : freeFileSystemSizeInBytes,
761
+                  @"total" : fileSystemSizeInBytes,
765 762
                 }]);
766 763
     } else {
767 764
         callback(@[@"failed to get storage usage."]);