From 9864bd576c7687d2241af3109b8e8117ef0352b9 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 26 May 2024 23:05:35 -0700 Subject: [PATCH] Call downloadProgress.clear(). --- Web/Sources/Web/DownloadSession.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Web/Sources/Web/DownloadSession.swift b/Web/Sources/Web/DownloadSession.swift index e5c176a3a..6e989250b 100755 --- a/Web/Sources/Web/DownloadSession.swift +++ b/Web/Sources/Web/DownloadSession.swift @@ -67,7 +67,7 @@ public protocol DownloadSessionDelegate: AnyObject { public func cancelAll() async { - clearDownloadProgress() + downloadProgress.clear() let (dataTasks, uploadTasks, downloadTasks) = await urlSession.tasks @@ -254,7 +254,7 @@ private extension DownloadSession { if tasksInProgress.count + tasksPending.count + queue.count < 1 { // Finished? allIdentifiers = Set() delegate?.downloadSessionDidComplete(self) - clearDownloadProgress() + downloadProgress.clear() } } @@ -263,11 +263,6 @@ private extension DownloadSession { downloadProgress.numberRemaining = tasksInProgress.count + tasksPending.count + queue.count } - func clearDownloadProgress() { - - downloadProgress = DownloadProgress(numberOfTasks: 0) - } - static let badRedirectStrings = ["solutionip", "lodgenet", "monzoon", "landingpage", "btopenzone", "register", "login", "authentic"] func urlStringIsDisallowedRedirect(_ urlString: String) -> Bool {