Исправил прыжки списка чатов при пустых запросах
This commit is contained in:
@@ -1792,6 +1792,11 @@ fun ChatsListScreen(
|
||||
val requestsCount = chatsState.requestsCount
|
||||
|
||||
val showSkeleton = isLoading
|
||||
val chatListState = rememberLazyListState()
|
||||
var isRequestsVisible by remember { mutableStateOf(true) }
|
||||
var lastAutoScrolledVerificationId by remember {
|
||||
mutableStateOf<String?>(null)
|
||||
}
|
||||
|
||||
AnimatedContent(
|
||||
targetState = showDownloadsScreen,
|
||||
@@ -2057,11 +2062,6 @@ fun ChatsListScreen(
|
||||
}
|
||||
|
||||
// Track scroll direction to hide/show Requests
|
||||
val chatListState = rememberLazyListState()
|
||||
var isRequestsVisible by remember { mutableStateOf(true) }
|
||||
var lastAutoScrolledVerificationId by remember {
|
||||
mutableStateOf<String?>(null)
|
||||
}
|
||||
val hapticFeedback = LocalHapticFeedback.current
|
||||
|
||||
// When a new device confirmation banner appears at the top,
|
||||
@@ -2163,13 +2163,11 @@ fun ChatsListScreen(
|
||||
}
|
||||
}
|
||||
|
||||
item(key = "requests_section") {
|
||||
val isRequestsSectionVisible =
|
||||
requestsCount > 0 &&
|
||||
isRequestsVisible
|
||||
AnimatedVisibility(
|
||||
visible =
|
||||
isRequestsSectionVisible,
|
||||
if (requestsCount > 0) {
|
||||
item(key = "requests_section") {
|
||||
AnimatedVisibility(
|
||||
visible =
|
||||
isRequestsVisible,
|
||||
enter =
|
||||
slideInVertically(
|
||||
initialOffsetY = {
|
||||
@@ -2238,27 +2236,28 @@ fun ChatsListScreen(
|
||||
tween(
|
||||
durationMillis =
|
||||
140
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
Column {
|
||||
RequestsSection(
|
||||
count =
|
||||
requestsCount,
|
||||
requests =
|
||||
requests,
|
||||
isDarkTheme =
|
||||
isDarkTheme,
|
||||
onClick = {
|
||||
openRequestsRouteSafely()
|
||||
}
|
||||
)
|
||||
Divider(
|
||||
color =
|
||||
dividerColor,
|
||||
thickness =
|
||||
0.5.dp
|
||||
)
|
||||
) {
|
||||
Column {
|
||||
RequestsSection(
|
||||
count =
|
||||
requestsCount,
|
||||
requests =
|
||||
requests,
|
||||
isDarkTheme =
|
||||
isDarkTheme,
|
||||
onClick = {
|
||||
openRequestsRouteSafely()
|
||||
}
|
||||
)
|
||||
Divider(
|
||||
color =
|
||||
dividerColor,
|
||||
thickness =
|
||||
0.5.dp
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user