Skip to content

Commit

Permalink
WIP: fix scope for unsued unread messages badges code
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Feb 14, 2024
1 parent 5e574ba commit f336ba0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ fun App()
val focusRequester = remember { FocusRequester() }
Row(modifier = Modifier.fillMaxWidth().randomDebugBorder()) {
val contacts by contactstore.stateFlow.collectAsState()
val ContactListScope = rememberCoroutineScope()
ContactList(contactList = contacts)
VerticalDivider()
if (contacts.selectedContactPubkey == null)
Expand All @@ -1077,8 +1078,8 @@ fun App()
{
Log.i(TAG, "CONTACTS -> draw")
load_messages_for_friend(contacts.selectedContactPubkey)
GlobalScope.launch { globalstore.try_clear_unread_message_count() }
GlobalScope.launch {
ContactListScope.launch {
globalstore.try_clear_unread_message_count()
globalfrndstoreunreadmsgs.try_clear_unread_per_friend_message_count(contacts.selectedContactPubkey)
}
ChatAppWithScaffold(focusRequester = focusRequester, contactList = contacts, ui_scale = ui_scale)
Expand Down Expand Up @@ -1110,6 +1111,7 @@ fun App()
{
load_grouppeers(groups.selectedGroupId!!)
}
val GroupPeerListScope = rememberCoroutineScope()
GroupPeerList(grouppeerList = grouppeers)
VerticalDivider()
if (groups.selectedGroupId == null)
Expand All @@ -1119,10 +1121,8 @@ fun App()
{
Log.i(TAG, "GROUPS -> draw")
load_groupmessages_for_friend(groups.selectedGroupId)
GlobalScope.launch {
GroupPeerListScope.launch {
globalstore.try_clear_unread_group_message_count()
}
GlobalScope.launch {
globalgrpstoreunreadmsgs.try_clear_unread_per_group_message_count(groups.selectedGroupId)
}
GroupAppWithScaffold(focusRequester = groupfocusRequester, groupList = groups, ui_scale = ui_scale)
Expand Down

0 comments on commit f336ba0

Please sign in to comment.