mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
fix: progress bar not updating
This commit is contained in:
parent
3232bb10e6
commit
f38b31a591
2 changed files with 9 additions and 7 deletions
|
@ -97,7 +97,7 @@ fun Steps(
|
|||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
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}"
|
||||
}
|
||||
|
||||
|
|
|
@ -71,15 +71,17 @@ fun PatcherScreen(
|
|||
|
||||
val patchesProgress by vm.patchesProgress.collectAsStateWithLifecycle()
|
||||
|
||||
val progress = remember(vm.steps, patchesProgress) {
|
||||
val current = vm.steps.filter {
|
||||
val progress by remember {
|
||||
derivedStateOf {
|
||||
val current = vm.steps.count {
|
||||
it.state == State.COMPLETED && it.category != StepCategory.PATCHING
|
||||
}.size + patchesProgress.first
|
||||
} + patchesProgress.first
|
||||
|
||||
val total = vm.steps.size - 1 + patchesProgress.second
|
||||
|
||||
current.toFloat() / total.toFloat()
|
||||
}
|
||||
}
|
||||
|
||||
if (showInstallPicker)
|
||||
InstallPickerDialog(
|
||||
|
|
Loading…
Reference in a new issue