Skip to content

Commit

Permalink
fix cancelUpload not working due to incorrect if condition
Browse files Browse the repository at this point in the history
  • Loading branch information
BaderSerhan committed Dec 31, 2018
1 parent 46d8a36 commit ddbe25b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/VydiaRNFileUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ - (void)copyAssetToFile: (NSString *)assetUrl completionHandler: (void(^)(NSStri
RCT_EXPORT_METHOD(cancelUpload: (NSString *)cancelUploadId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
[_urlSession getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
for (NSURLSessionTask *uploadTask in uploadTasks) {
if (uploadTask.taskDescription == cancelUploadId) {
if ([uploadTask.taskDescription isEqualToString:cancelUploadId]){
// == checks if references are equal, while isEqualToString checks the string value
[uploadTask cancel];
}
}
Expand Down

0 comments on commit ddbe25b

Please sign in to comment.