From 073389e95a1f8c987e005a00663451b798551032 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Tue, 25 Jun 2024 14:02:02 +0700 Subject: [PATCH] Fix[MCDL]: progress may hang due to indeterminate value --- Natives/MinecraftResourceDownloadTask.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Natives/MinecraftResourceDownloadTask.m b/Natives/MinecraftResourceDownloadTask.m index 58f21a3f75..a4c3258e85 100644 --- a/Natives/MinecraftResourceDownloadTask.m +++ b/Natives/MinecraftResourceDownloadTask.m @@ -77,6 +77,7 @@ - (void)addDownloadTaskToProgress:(NSURLSessionDownloadTask *)task size:(NSUInte NSProgress *progress = [self.manager downloadProgressForTask:task]; NSUInteger fileSize = size ?: 1; progress.kind = NSProgressKindFile; + progress.totalUnitCount = fileSize; [self.progressList addObject:progress]; [self.progress addChild:progress withPendingUnitCount:fileSize]; self.progress.totalUnitCount += fileSize;