mirror of
https://github.com/revanced/revanced-manager-compose.git
synced 2025-04-29 22:04:25 +02:00
fix(installer): save step incorrectly being marked as completed
This commit is contained in:
parent
346b9e55ea
commit
ac147b818e
@ -75,12 +75,15 @@ class PatcherProgressManager(context: Context, selectedPatches: List<String>) {
|
|||||||
steps[stepKeyMap[Progress.PatchingStart]!!.step] = generatePatchesStep(newList)
|
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) }
|
currentStep?.let { update(it, newState, message) }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun handle(progress: Progress) = success().also {
|
fun handle(progress: Progress) = when (val step = stepKeyMap[progress]) {
|
||||||
stepKeyMap[progress]?.let { currentStep = it }
|
null -> success()
|
||||||
|
currentStep -> {}
|
||||||
|
else -> success().also { currentStep = step }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun failure(error: Throwable) = updateCurrent(
|
fun failure(error: Throwable) = updateCurrent(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user