Browse Source

Cancel action remove added

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 year ago
parent
commit
3e4cccfc5f

+ 2 - 0
app/src/main/java/com/nextcloud/client/files/downloader/FileDownloadWorker.kt

@@ -139,6 +139,7 @@ class FileDownloadWorker(
             showCompleteNotification()
 
             setIdleWorkerState()
+
             Log_OC.e(TAG, "FilesDownloadWorker successfully completed")
             Result.success()
         } catch (t: Throwable) {
@@ -173,6 +174,7 @@ class FileDownloadWorker(
     private fun cancelAllDownloads() {
         pendingDownloads.all.forEach {
             it.value.payload?.cancel()
+            pendingDownloadFileIds.remove(Pair(it.value.payload?.user?.accountName, it.value.payload?.file?.fileId))
         }
     }