fix(installer): save step incorrectly being marked as completed

This commit is contained in:
Ax333l 2023-06-29 10:11:44 +02:00
parent 346b9e55ea
commit ac147b818e
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23

View File

@ -75,12 +75,15 @@ class PatcherProgressManager(context: Context, selectedPatches: List<String>) {
steps[stepKeyMap[Progress.PatchingStart]!!.step] = generatePatchesStep(newList)
}
private fun updateCurrent(newState: State, message: String? = null) =
private fun updateCurrent(newState: State, message: String? = null) {
currentStep?.let { update(it, newState, message) }
}
fun handle(progress: Progress) = success().also {
stepKeyMap[progress]?.let { currentStep = it }
fun handle(progress: Progress) = when (val step = stepKeyMap[progress]) {
null -> success()
currentStep -> {}
else -> success().also { currentStep = step }
}
fun failure(error: Throwable) = updateCurrent(