Browse Source

Fix #225 IOS upload progress

Ben Hsieh 8 years ago
parent
commit
1c7328484b
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/ios/RNFetchBlobNetwork.m

+ 8
- 0
src/ios/RNFetchBlobNetwork.m View File

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