Browse Source

Fix incremental response

Ben Hsieh 8 years ago
parent
commit
7bc952c55f
2 changed files with 5 additions and 5 deletions
  1. 3
    3
      src/ios/RNFetchBlobFS.m
  2. 2
    2
      src/ios/RNFetchBlobProgress.m

+ 3
- 3
src/ios/RNFetchBlobFS.m View File

412
             }
412
             }
413
             else
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
                     return;
418
                     return;
419
                 }
419
                 }
420
                 fileContent = [NSData dataWithContentsOfFile:path];
420
                 fileContent = [NSData dataWithContentsOfFile:path];

+ 2
- 2
src/ios/RNFetchBlobProgress.m View File

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