Scroll timeline to the top when synchronization is over
This commit is contained in:
parent
19409f20a5
commit
ffe2d5cffb
@ -322,7 +322,9 @@ class TimelineScreenModel(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun resetEndSynchronizing() {
|
||||||
|
_timelineState.update { it.copy(endSynchronizing = false) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Stable
|
@Stable
|
||||||
|
@ -102,6 +102,13 @@ object TimelineTab : Tab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(state.endSynchronizing) {
|
||||||
|
if (state.endSynchronizing) {
|
||||||
|
lazyListState.animateScrollToItem(0)
|
||||||
|
viewModel.resetEndSynchronizing()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val drawerState = rememberDrawerState(
|
val drawerState = rememberDrawerState(
|
||||||
initialValue = DrawerValue.Closed,
|
initialValue = DrawerValue.Closed,
|
||||||
confirmStateChange = {
|
confirmStateChange = {
|
||||||
@ -147,7 +154,7 @@ object TimelineTab : Tab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(state.syncError) {
|
LaunchedEffect(state.syncError) {
|
||||||
if (state.syncError != null) {
|
if (state.syncError != null) {
|
||||||
snackbarHostState.showSnackbar(ErrorMessage.get(state.syncError!!, context))
|
snackbarHostState.showSnackbar(ErrorMessage.get(state.syncError!!, context))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user