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

View File

@@ -11,7 +11,7 @@ android {
applicationId "chat.simplex.app"
minSdk 29
targetSdk 32
versionCode 11
versionCode 12
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -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)