Skip to content

Commit

Permalink
Fix installer not working as expected
Browse files Browse the repository at this point in the history
- Remove packageName from queue after removing it from state

- Cleanup quicker then usual
  • Loading branch information
Iamlooker committed Oct 20, 2023
1 parent a3298b5 commit aa102b4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ class InstallManager(
}
}
}.consumeEach { item ->
if (state.value[item.packageName] != null) {
currentQueue.remove(item.packageName.name)
if (state.value.containsKey(item.packageName)) {
updateState { put(item.packageName, InstallState.Installing) }
val success = installer.install(item)
installer.cleanup()
updateState { put(item.packageName, success) }
currentQueue.remove(item.packageName.name)
context.notificationManager?.cancel(
"download-${item.packageName.name}",
Constants.NOTIFICATION_ID_DOWNLOADING
)
installer.cleanup()
}
}
}
Expand Down

0 comments on commit aa102b4

Please sign in to comment.