From bd7f5979864e9a18a00df9853ad5d744c3659ef1 Mon Sep 17 00:00:00 2001 From: OneWay Date: Tue, 1 Sep 2026 11:45:41 +0800 Subject: [PATCH] fix: report Idle instead of fake Success when nothing is downloaded The early return skipped the terminal-state delay and reset, leaving a phantom 100% Success (and a stuck "indexing" bar plus a success notification) for downloads that never happened. --- .../example/research/feature/download/DownloadManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/research/feature/download/DownloadManager.kt b/app/src/main/java/com/example/research/feature/download/DownloadManager.kt index 58d86fd..d7b8347 100644 --- a/app/src/main/java/com/example/research/feature/download/DownloadManager.kt +++ b/app/src/main/java/com/example/research/feature/download/DownloadManager.kt @@ -58,7 +58,7 @@ class DownloadManager( if (enabledSources.isEmpty()) { dictionaryRepository.performAllCleanup() - updateDownloadProgressState(DownloadState.Success, 1f) + updateDownloadProgressState(DownloadState.Idle, 0f) return@withLock } @@ -142,7 +142,7 @@ class DownloadManager( mutex.withLock { try { if (sourceUrls.isEmpty()) { - updateDownloadProgressState(DownloadState.Success, 1f) + updateDownloadProgressState(DownloadState.Idle, 0f) return@withLock } @@ -153,7 +153,7 @@ class DownloadManager( } if (sources.isEmpty()) { - updateDownloadProgressState(DownloadState.Success, 1f) + updateDownloadProgressState(DownloadState.Idle, 0f) return@withLock }