Skip to content

Commit

Permalink
fix scope on some calls
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Feb 14, 2024
1 parent f336ba0 commit 49d0b47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.contentDescription
Expand Down Expand Up @@ -50,9 +51,10 @@ fun ContactList(
key = { item -> item.pubkey },
contentType = { item -> item::class }
) { item ->
val ListItemViewScope = rememberCoroutineScope()
ListItemView(
onSelect = {
GlobalScope.launch { globalstore.try_clear_unread_message_count() }
ListItemViewScope.launch { globalstore.try_clear_unread_message_count() }
globalfrndstoreunreadmsgs.hard_clear_unread_per_friend_message_count(item.pubkey)
contactstore.select(item.pubkey)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.foundation.selection.selectableGroup
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.semantics.contentDescription
Expand Down Expand Up @@ -52,10 +53,11 @@ fun GroupList(
key = { item -> item.groupId },
contentType = { item -> item::class }
) { item ->
val ListItemViewScope = rememberCoroutineScope()
ListItemView(
onSelect = {
groupsettingsstore.visible(false)
GlobalScope.launch {
ListItemViewScope.launch {
globalstore.try_clear_unread_group_message_count()
}
globalgrpstoreunreadmsgs.hard_clear_unread_per_group_message_count(item.groupId)
Expand Down

0 comments on commit 49d0b47

Please sign in to comment.