mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-01 22:34:25 +02:00
fix: progress bar not updating
This commit is contained in:
parent
3232bb10e6
commit
f38b31a591
@ -97,7 +97,7 @@ fun Steps(
|
|||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
|
||||||
val stepProgress = remember(stepCount, steps) {
|
val stepProgress = remember(stepCount, steps) {
|
||||||
stepCount?.let { (current, total) -> "$current/$total}" }
|
stepCount?.let { (current, total) -> "$current/$total" }
|
||||||
?: "${steps.count { it.state == State.COMPLETED }}/${steps.size}"
|
?: "${steps.count { it.state == State.COMPLETED }}/${steps.size}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,14 +71,16 @@ fun PatcherScreen(
|
|||||||
|
|
||||||
val patchesProgress by vm.patchesProgress.collectAsStateWithLifecycle()
|
val patchesProgress by vm.patchesProgress.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
val progress = remember(vm.steps, patchesProgress) {
|
val progress by remember {
|
||||||
val current = vm.steps.filter {
|
derivedStateOf {
|
||||||
it.state == State.COMPLETED && it.category != StepCategory.PATCHING
|
val current = vm.steps.count {
|
||||||
}.size + patchesProgress.first
|
it.state == State.COMPLETED && it.category != StepCategory.PATCHING
|
||||||
|
} + patchesProgress.first
|
||||||
|
|
||||||
val total = vm.steps.size - 1 + patchesProgress.second
|
val total = vm.steps.size - 1 + patchesProgress.second
|
||||||
|
|
||||||
current.toFloat() / total.toFloat()
|
current.toFloat() / total.toFloat()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showInstallPicker)
|
if (showInstallPicker)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user