Skip to content

Commit

Permalink
dispatch downloadProgressBlock even if content length is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
alicata committed Jun 12, 2024
1 parent 27c64f9 commit 5507b8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Network/RCTNetworkTask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ - (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data
incrementalDataBlock(data, length, total);
}];
}
if (_downloadProgressBlock && total > 0) {
if (_downloadProgressBlock) {
RCTURLRequestProgressBlock downloadProgressBlock = _downloadProgressBlock;
[self dispatchCallback:^{
downloadProgressBlock(length, total);
Expand Down

0 comments on commit 5507b8b

Please sign in to comment.