Эх сурвалжийг харах

Add TODO for some unknown code block

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 жил өмнө
parent
commit
9b124d402b

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

@@ -288,12 +288,16 @@ class FileDownloadWorker(
         download: DownloadFileOperation,
         downloadResult: RemoteOperationResult<*>
     ) {
-        dismissDownloadInProgressNotification()
-
         if (downloadResult.isCancelled) {
             return
         }
 
+        // TODO Check why we calling only for success?
+        if (downloadResult.isSuccess) {
+            dismissDownloadInProgressNotification()
+            return
+        }
+
         val needsToUpdateCredentials = (ResultCode.UNAUTHORIZED == downloadResult.code)
         notificationManager.run {
             prepareForResult(downloadResult, needsToUpdateCredentials)

+ 2 - 0
app/src/main/java/com/nextcloud/client/notifications/download/DownloadNotificationManager.kt

@@ -83,6 +83,8 @@ class DownloadNotificationManager(private val context: Context, private val view
 
     @Suppress("MagicNumber")
     fun notifyForResult(result: RemoteOperationResult<*>, download: DownloadFileOperation) {
+        dismissDownloadInProgressNotification()
+
         val tickerId = getTickerId(result.isSuccess, null)
         val notifyId = SecureRandom().nextInt()