android: fix app crashing on opening chats, build 12 (#439)

This commit is contained in:
Evgeny Poberezkin
2022-03-14 21:03:36 +00:00
committed by GitHub
parent 6ba7d208c8
commit e4ea2035ff
2 changed files with 2 additions and 2 deletions
@@ -165,7 +165,7 @@ fun ChatItemsList(chatItems: List<ChatItem>) {
ChatItemView(cItem, uriHandler)
}
val len = chatItems.count()
if (keyboardState != ciListState.value.keyboardState || !ciListState.value.scrolled || len != ciListState.value.itemCount) {
if (len > 1 && (keyboardState != ciListState.value.keyboardState || !ciListState.value.scrolled || len != ciListState.value.itemCount)) {
scope.launch {
ciListState.value = CIListState(true, len, keyboardState)
listState.animateScrollToItem(len - 1)