|
|
@@ -379,15 +379,15 @@ class ImageLoadingProgressSideEffect: DataReceivingSideEffect {
|
|
|
}
|
|
|
|
|
|
func onDataReceived(_ session: URLSession, task: SessionDataTask, data: Data) {
|
|
|
- DispatchQueue.main.async {
|
|
|
- guard self.onShouldApply() else { return }
|
|
|
- guard let expectedContentLength = task.task.response?.expectedContentLength,
|
|
|
- expectedContentLength != -1 else
|
|
|
- {
|
|
|
- return
|
|
|
- }
|
|
|
+ guard self.onShouldApply() else { return }
|
|
|
+ guard let expectedContentLength = task.task.response?.expectedContentLength,
|
|
|
+ expectedContentLength != -1 else
|
|
|
+ {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- let dataLength = Int64(task.mutableData.count)
|
|
|
+ let dataLength = Int64(task.mutableData.count)
|
|
|
+ DispatchQueue.main.async {
|
|
|
self.block(dataLength, expectedContentLength)
|
|
|
}
|
|
|
}
|