Ver código fonte

Fix #225 IOS upload progress

Ben Hsieh 7 anos atrás
pai
commit
1c7328484b
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8
    0
      src/ios/RNFetchBlobNetwork.m

+ 8
- 0
src/ios/RNFetchBlobNetwork.m Ver arquivo

@@ -159,11 +159,19 @@ NSOperationQueue *taskQueue;
159 159
 
160 160
 + (void) enableProgressReport:(NSString *) taskId config:(RNFetchBlobProgress *)config
161 161
 {
162
+    if(progressTable == nil)
163
+    {
164
+        progressTable = [[NSMutableDictionary alloc] init];
165
+    }
162 166
     [progressTable setValue:config forKey:taskId];
163 167
 }
164 168
 
165 169
 + (void) enableUploadProgress:(NSString *) taskId config:(RNFetchBlobProgress *)config
166 170
 {
171
+    if(uploadProgressTable == nil)
172
+    {
173
+        uploadProgressTable = [[NSMutableDictionary alloc] init];
174
+    }
167 175
     [uploadProgressTable setValue:config forKey:taskId];
168 176
 }
169 177