Fix: Showing install action while download is running (closes #251)

This commit is contained in:
machiav3lli 2022-07-27 01:43:14 +02:00
parent 193286b894
commit c990114b57

View File

@ -54,7 +54,8 @@ class AppViewModelX(val db: DatabaseX, val packageName: String) : ViewModel() {
val product = findSuggestedProduct(productRepos, installed) { it.first }?.first
val compatible = product != null && product.selectedReleases.firstOrNull()
.let { it != null && it.incompatibilities.isEmpty() }
val canInstall = product != null && installed == null && compatible
val canInstall =
product != null && installed == null && compatible && downloadState.value == null
val canUpdate =
product != null && compatible && product.canUpdate(installed) &&
!shouldIgnore(product.versionCode)