From 04697a2623dc8eb4aa498ea489db975d628e8937 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Thu, 11 Jan 2024 16:31:39 +0100 Subject: [PATCH] Fix cancel in same root Signed-off-by: alperozturk --- .../client/files/downloader/FileDownloadWorker.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt b/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt index 41fc19f0576c..818775643e90 100644 --- a/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt +++ b/app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt @@ -161,8 +161,6 @@ class FileDownloadWorker( Log_OC.e(TAG, "FilesDownloadWorker stopped") notificationManager.dismissNotification() - cancelAllDownloads() - removePendingDownload(currentDownload?.user?.accountName) setIdleWorkerState() super.onStopped() @@ -173,16 +171,9 @@ class FileDownloadWorker( } private fun setIdleWorkerState() { - currentDownload = null WorkerStateLiveData.instance().setWorkState(WorkerState.Idle) } - private fun cancelAllDownloads() { - pendingDownloads.all.forEach { - it.value.payload?.cancel() - } - } - private fun removePendingDownload(accountName: String?) { pendingDownloads.remove(accountName) }