mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 08:45:27 +02:00
Fix crash on chips scroll
This commit is contained in:
parent
7e6036f4ce
commit
75ed884611
@ -102,15 +102,16 @@ private fun LeftSideScreen(
|
||||
val chipsRowLazyListState = rememberLazyListState()
|
||||
|
||||
LaunchedEffect(uiState.unitFrom, uiState.shownUnitGroups) {
|
||||
// TODO Scroll to initially selected unit group
|
||||
if (uiState.unitFrom == null) return@LaunchedEffect
|
||||
updateUnitGroup(uiState.unitFrom.group)
|
||||
|
||||
val groupToSelect = uiState.shownUnitGroups.indexOf(uiState.unitFrom.group)
|
||||
if (groupToSelect > -1) {
|
||||
kotlin.runCatching {
|
||||
chipsRowLazyListState.animateScrollToItem(groupToSelect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
|
Loading…
x
Reference in New Issue
Block a user