@@ -89,22 +89,24 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
89
89
90
90
@synchronized ([RNFetchBlobNetwork class ]) {
91
91
[self .requestsTable setObject: request forKey: taskId];
92
- [self checkProgressConfig ];
92
+ [self checkProgressConfigForTask: taskId ];
93
93
}
94
94
}
95
95
96
- - (void ) checkProgressConfig {
96
+ - (void ) checkProgressConfigForTask : ( NSString *) taskId {
97
97
// reconfig progress
98
- [self .rebindProgressDict enumerateKeysAndObjectsUsingBlock: ^(NSString * _Nonnull key, RNFetchBlobProgress * _Nonnull config, BOOL * _Nonnull stop) {
99
- [self enableProgressReport: key config: config];
100
- }];
101
- [self .rebindProgressDict removeAllObjects ];
98
+ RNFetchBlobProgress *downloadConfig = self.rebindProgressDict [taskId];
99
+ if (downloadConfig != nil ) {
100
+ [self enableProgressReport: taskId config: downloadConfig];
101
+ [self .rebindProgressDict removeObjectForKey: taskId];
102
+ }
102
103
103
104
// reconfig uploadProgress
104
- [self .rebindUploadProgressDict enumerateKeysAndObjectsUsingBlock: ^(NSString * _Nonnull key, RNFetchBlobProgress * _Nonnull config, BOOL * _Nonnull stop) {
105
- [self enableUploadProgress: key config: config];
106
- }];
107
- [self .rebindUploadProgressDict removeAllObjects ];
105
+ RNFetchBlobProgress *uploadConfig = self.rebindUploadProgressDict [taskId];
106
+ if (uploadConfig != nil ) {
107
+ [self enableUploadProgress: taskId config: uploadConfig];
108
+ [self .rebindUploadProgressDict removeObjectForKey: taskId];
109
+ }
108
110
}
109
111
110
112
- (void ) enableProgressReport : (NSString *) taskId config : (RNFetchBlobProgress *)config
0 commit comments