Skip to content

Commit

Permalink
Commit with unresolved merge conflicts outside of kalium
Browse files Browse the repository at this point in the history
  • Loading branch information
Garzas authored and github-actions[bot] committed Apr 9, 2024
1 parent 2a11540 commit 7cc08c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ private fun SnackBarMessage(
}
}

@Suppress("ComplexMethod")
@Suppress("ComplexMethod", "ComplexCondition")
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Composable
fun MessageList(
Expand Down Expand Up @@ -938,11 +938,15 @@ fun MessageList(
}
}

// update last read message on start
// update last read message on start or when list is not scrollable
LaunchedEffect(lazyPagingMessages.itemCount) {
if (!readLastMessageAtStartTriggered.value && lazyPagingMessages.itemSnapshotList.items.isNotEmpty()) {
if ((!readLastMessageAtStartTriggered.value || (!lazyListState.canScrollBackward && !lazyListState.canScrollForward))
&& lazyPagingMessages.itemSnapshotList.items.isNotEmpty()
) {
val lastVisibleMessage = lazyPagingMessages[lazyListState.firstVisibleItemIndex] ?: return@LaunchedEffect
readLastMessageAtStartTriggered.value = true
if (!readLastMessageAtStartTriggered.value) {
readLastMessageAtStartTriggered.value = true
}
updateLastReadMessage(lastVisibleMessage, lastUnreadMessageInstant, onUpdateConversationReadDate)
}
}
Expand Down

0 comments on commit 7cc08c9

Please sign in to comment.