mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-22 19:02:12 +00:00
Fix: Showing install and update at once
This commit is contained in:
parent
a64afc3d6a
commit
a5449afe9b
@ -65,9 +65,9 @@ class AppViewModelX(val db: DatabaseX, val packageName: String) : ViewModel() {
|
|||||||
val bookmarked = extras.value?.favorite ?: false
|
val bookmarked = extras.value?.favorite ?: false
|
||||||
|
|
||||||
val actions = mutableSetOf<ActionState>()
|
val actions = mutableSetOf<ActionState>()
|
||||||
launch {
|
synchronized(actions) {
|
||||||
if (canInstall) actions += ActionState.Install
|
|
||||||
if (canUpdate) actions += ActionState.Update
|
if (canUpdate) actions += ActionState.Update
|
||||||
|
if (canInstall && !canUpdate) actions += ActionState.Install
|
||||||
if (canLaunch) actions += ActionState.Launch
|
if (canLaunch) actions += ActionState.Launch
|
||||||
if (installed != null) actions += ActionState.Details
|
if (installed != null) actions += ActionState.Details
|
||||||
if (canUninstall) actions += ActionState.Uninstall
|
if (canUninstall) actions += ActionState.Uninstall
|
||||||
@ -85,7 +85,7 @@ class AppViewModelX(val db: DatabaseX, val packageName: String) : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
this@AppViewModelX.actions.value = actions
|
synchronized(actions) { this@AppViewModelX.actions.value = actions }
|
||||||
|
|
||||||
if (downloadState.value != null && mainAction.value?.textId != downloadState.value?.textId)
|
if (downloadState.value != null && mainAction.value?.textId != downloadState.value?.textId)
|
||||||
downloadState.value?.let {
|
downloadState.value?.let {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user