fix: reset dictionary progress bar between indexing operations
monotonicTargetProgress is held in remember and only ever grows via maxOf, so when a new indexing starts after a previous one reached a higher value the bar is left at the old level while the percent label starts at 0. Snap it to the current target when the section becomes visible so the bar follows the new operation from its first frame.
This commit is contained in:
+5
@@ -41,6 +41,11 @@ fun DictionaryProgressSection(
|
||||
var displayedPercent by remember { mutableIntStateOf(percent) }
|
||||
var displayedTestTag by remember { mutableStateOf(testTag) }
|
||||
|
||||
LaunchedEffect(visible) {
|
||||
if (visible) {
|
||||
monotonicTargetProgress = targetProgress
|
||||
}
|
||||
}
|
||||
LaunchedEffect(visible, targetProgress) {
|
||||
if (visible) {
|
||||
monotonicTargetProgress = maxOf(monotonicTargetProgress, targetProgress)
|
||||
|
||||
Reference in New Issue
Block a user