diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ChatView.kt b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ChatView.kt index b155f33f26..c9cb6d6f4f 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ChatView.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ChatView.kt @@ -674,10 +674,18 @@ private fun ScrollToBottom(chatId: ChatId, listState: LazyListState, chatItems: .distinctUntilChanged() .filter { listState.layoutInfo.visibleItemsInfo.firstOrNull()?.key != it } .collect { - if (listState.firstVisibleItemIndex == 0) { - listState.animateScrollToItem(0) - } else { - listState.animateScrollBy(scrollDistance) + try { + if (listState.firstVisibleItemIndex == 0) { + listState.animateScrollToItem(0) + } else { + listState.animateScrollBy(scrollDistance) + } + } catch (e: CancellationException) { + /** + * When you tap and hold a finger on a lazy column with chatItems, and then you receive a message, + * this coroutine will be canceled with the message "Current mutation had a higher priority" because of animatedScroll. + * Which breaks auto-scrolling to bottom. So just ignoring the exception + * */ } } }