mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-16 03:31:02 -04:00
UpdatesFragment: Check if downloads are running instead of finished
Update all button otherwise shows cancel on first run Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -10,5 +10,6 @@ enum class DownloadStatus {
|
||||
|
||||
companion object {
|
||||
val finished = listOf(FAILED, CANCELLED, COMPLETED)
|
||||
val running = listOf(QUEUED, DOWNLOADING)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ data class Download(
|
||||
val sharedLibs: List<SharedLib>
|
||||
) : Parcelable {
|
||||
val isFinished get() = downloadStatus in DownloadStatus.finished
|
||||
val isRunning get() = downloadStatus in DownloadStatus.running
|
||||
|
||||
companion object {
|
||||
fun fromApp(app: App): Download {
|
||||
|
||||
@@ -95,7 +95,7 @@ class UpdatesFragment : BaseFragment(R.layout.fragment_updates) {
|
||||
}.collectLatest { map ->
|
||||
updateController(map)
|
||||
binding.swipeRefreshLayout.isRefreshing = false
|
||||
viewModel.updateAllEnqueued = map?.values?.all { it?.isFinished != true } ?: false
|
||||
viewModel.updateAllEnqueued = map?.values?.all { it?.isRunning == true } ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user