Skip to content

Commit

Permalink
fix(installer): save step incorrectly being marked as completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Jun 29, 2023
1 parent 149c8cc commit 18cbe51
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 18cbe51

Please sign in to comment.