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 7b49189 commit 8084223
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 8084223

Please sign in to comment.