Skip to content

Commit

Permalink
Fix added to pending state on repeated install
Browse files Browse the repository at this point in the history
  • Loading branch information
Iamlooker committed Oct 18, 2023
1 parent c3fef8b commit 4b3d728
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ class InstallManager(
private fun CoroutineScope.installer() = launch {
val currentQueue = mutableSetOf<String>()
installItems.filter { item ->
currentQueue.addAndCompute(item.packageName.name) {
updateState { put(item.packageName, InstallState.Pending) }
currentQueue.addAndCompute(item.packageName.name) { isAdded ->
if (isAdded) {
updateState { put(item.packageName, InstallState.Pending) }
}
}
}.consumeEach { item ->
if (state.value[item.packageName] != null) {
Expand Down

0 comments on commit 4b3d728

Please sign in to comment.