Quellcode durchsuchen

Fix incremental response

Ben Hsieh vor 8 Jahren
Ursprung
Commit
7bc952c55f
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 3
    3
      src/ios/RNFetchBlobFS.m
  2. 2
    2
      src/ios/RNFetchBlobProgress.m

+ 3
- 3
src/ios/RNFetchBlobFS.m Datei anzeigen

@@ -412,9 +412,9 @@ NSMutableDictionary *fileStreams = nil;
412 412
             }
413 413
             else
414 414
             {
415
-                BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:path];
416
-                if(!exists) {
417
-                    reject(@"RNFetchBlobFS readFile error", @"file not exists", [[NSError alloc]init]);
415
+                if(![[NSFileManager defaultManager] fileExistsAtPath:path]) {
416
+                    
417
+                    reject(@"RNFetchBlobFS readFile error", @"file not exists", nil);
418 418
                     return;
419 419
                 }
420 420
                 fileContent = [NSData dataWithContentsOfFile:path];

+ 2
- 2
src/ios/RNFetchBlobProgress.m Datei anzeigen

@@ -32,7 +32,7 @@
32 32
 
33 33
 -(BOOL)shouldReport:(NSNumber *)nextProgress
34 34
 {
35
-    BOOL result = YES;
35
+    BOOL * result = YES;
36 36
     float countF = [self.count floatValue];
37 37
     if(countF > 0 && [nextProgress floatValue] > 0)
38 38
     {
@@ -43,7 +43,7 @@
43 43
     // NSTimeInterval is defined as double
44 44
     NSNumber *timeStampObj = [NSNumber numberWithDouble: timeStamp];
45 45
     float delta = [timeStampObj doubleValue] - lastTick;
46
-    BOOL shouldReport = delta > [self.interval doubleValue] && self.enable && result;
46
+    BOOL * shouldReport = delta > [self.interval doubleValue] && self.enable && result;
47 47
     if(shouldReport)
48 48
     {
49 49
         tick++;