Compare commits
5
Commits
main
..
9c76ebe3ff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c76ebe3ff | ||
|
|
4040ad7c4e | ||
|
|
d8c75e72e4 | ||
|
|
9fd8a555f1 | ||
|
|
df505a71b1 |
No files matched your search
@@ -52,13 +52,6 @@ class DownloadManager(
|
||||
var onDownloadSuccess: (() -> Unit)? = null
|
||||
var onTerminal: ((DownloadState) -> Unit)? = null
|
||||
|
||||
private suspend fun expireErrorStateToIdle() {
|
||||
delay(TERMINAL_STATE_DURATION)
|
||||
if (downloadState.value is DownloadState.Error) {
|
||||
updateDownloadProgressState(DownloadState.Idle, 0f)
|
||||
}
|
||||
}
|
||||
|
||||
fun startDownload() {
|
||||
if (downloadState.value is DownloadState.Loading) return
|
||||
if (!downloadScope.isActive) return
|
||||
@@ -86,7 +79,6 @@ class DownloadManager(
|
||||
updateDownloadProgressState(
|
||||
DownloadState.Error(sourceUnavailableMessage), 0f
|
||||
)
|
||||
expireErrorStateToIdle()
|
||||
return@withLock
|
||||
}
|
||||
|
||||
@@ -143,7 +135,6 @@ class DownloadManager(
|
||||
}
|
||||
|
||||
}
|
||||
expireErrorStateToIdle()
|
||||
}
|
||||
} finally {
|
||||
downloadJob = null
|
||||
@@ -183,7 +174,6 @@ class DownloadManager(
|
||||
updateDownloadProgressState(
|
||||
DownloadState.Error(sourceUnavailableMessage), 0f
|
||||
)
|
||||
expireErrorStateToIdle()
|
||||
return@withLock
|
||||
}
|
||||
|
||||
@@ -240,7 +230,6 @@ class DownloadManager(
|
||||
}
|
||||
|
||||
}
|
||||
expireErrorStateToIdle()
|
||||
}
|
||||
} finally {
|
||||
downloadJob = null
|
||||
|
||||
@@ -64,11 +64,7 @@ fun MainRoute(
|
||||
dictionary.isActive && dictionary.articleCount > 0
|
||||
}
|
||||
|
||||
val downloadSettled = settingsState.downloadState.let { state ->
|
||||
state is DownloadState.Idle || state is DownloadState.Error
|
||||
}
|
||||
|
||||
downloadSettled &&
|
||||
settingsState.downloadState is DownloadState.Idle &&
|
||||
!settingsState.indexingProgress.isIndexing &&
|
||||
settingsState.importState !is ImportState.Importing &&
|
||||
settingsState.importState !is ImportState.Extracting &&
|
||||
|
||||
Reference in new issue
Block a user