mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-14 19:05:27 +00:00
unneeded coroutineScope
This commit is contained in:
+3
-3
@@ -43,7 +43,7 @@ suspend fun processLoadedChat(
|
||||
contentTag: MsgContentTag?,
|
||||
pagination: ChatPagination,
|
||||
visibleItemIndexesNonReversed: () -> IntRange = { 0 .. 0 }
|
||||
) = coroutineScope {
|
||||
) {
|
||||
val chatState = chatModel.chatStateForContent(contentTag)
|
||||
val (splits, unreadAfterItemId, totalAfter, unreadTotal, unreadAfter, unreadAfterNewestLoaded) = chatState
|
||||
val oldItems = chatModel.chatItemsForContent(contentTag).value
|
||||
@@ -79,7 +79,7 @@ suspend fun processLoadedChat(
|
||||
is ChatPagination.Before -> {
|
||||
newItems.addAll(oldItems)
|
||||
val indexInCurrentItems: Int = oldItems.indexOfFirst { it.id == pagination.chatItemId }
|
||||
if (indexInCurrentItems == -1) return@coroutineScope
|
||||
if (indexInCurrentItems == -1) return
|
||||
val (newIds, _) = mapItemsToIds(chat.chatItems)
|
||||
val wasSize = newItems.size
|
||||
val (oldUnreadSplitIndex, newUnreadSplitIndex, trimmedIds, newSplits) = removeDuplicatesAndModifySplitsOnBeforePagination(
|
||||
@@ -96,7 +96,7 @@ suspend fun processLoadedChat(
|
||||
is ChatPagination.After -> {
|
||||
newItems.addAll(oldItems)
|
||||
val indexInCurrentItems: Int = oldItems.indexOfFirst { it.id == pagination.chatItemId }
|
||||
if (indexInCurrentItems == -1) return@coroutineScope
|
||||
if (indexInCurrentItems == -1) return
|
||||
|
||||
val mappedItems = mapItemsToIds(chat.chatItems)
|
||||
val newIds = mappedItems.first
|
||||
|
||||
Reference in New Issue
Block a user