android, desktop: fix banner not showing when creating chat with member; when creating group (#6139)

* android, desktop: fix banner not showing when creating chat with member

* fix group
This commit is contained in:
spaced4ndy
2025-08-01 16:09:20 +01:00
committed by GitHub
parent 1fb8e63680
commit 9a8ed40082
2 changed files with 9 additions and 10 deletions
@@ -34,7 +34,7 @@ import chat.simplex.common.views.newchat.*
import chat.simplex.common.views.usersettings.SettingsActionItem
import chat.simplex.common.model.GroupInfo
import chat.simplex.common.platform.*
import chat.simplex.common.views.chatlist.openLoadedChat
import chat.simplex.common.views.chatlist.openDirectChat
import chat.simplex.res.MR
import dev.icerock.moko.resources.StringResource
import kotlinx.datetime.Clock
@@ -57,6 +57,7 @@ fun GroupMemberInfoView(
val connStats = remember { mutableStateOf(connectionStats) }
val developerTools = chatModel.controller.appPrefs.developerTools.get()
var progressIndicator by remember { mutableStateOf(false) }
val scope = rememberCoroutineScope()
fun syncMemberConnection() {
withBGApi {
@@ -86,12 +87,10 @@ fun GroupMemberInfoView(
developerTools,
connectionCode,
getContactChat = { chatModel.getContactChat(it) },
openDirectChat = {
withBGApi {
apiLoadMessages(chatModel.chatsContext, rhId, ChatType.Direct, it, ChatPagination.Initial(ChatPagination.INITIAL_COUNT))
if (chatModel.getContactChat(it) != null) {
closeAll()
}
openDirectChat = { contactId ->
scope.launch {
openDirectChat(rhId, contactId)
closeAll()
}
},
createMemberContact = {
@@ -104,7 +103,7 @@ fun GroupMemberInfoView(
withContext(Dispatchers.Main) {
chatModel.chatsContext.addChat(memberChat)
}
openLoadedChat(memberChat)
openDirectChat(rhId, memberContact.contactId)
closeAll()
chatModel.setContactNetworkStatus(memberContact, NetworkStatus.Connected())
}
@@ -25,6 +25,7 @@ import chat.simplex.common.views.helpers.*
import chat.simplex.common.platform.*
import chat.simplex.common.views.*
import chat.simplex.common.views.chat.group.GroupLinkView
import chat.simplex.common.views.chatlist.openGroupChat
import chat.simplex.common.views.usersettings.*
import chat.simplex.res.MR
import kotlinx.coroutines.delay
@@ -44,8 +45,7 @@ fun AddGroupView(chatModel: ChatModel, rh: RemoteHostInfo?, close: () -> Unit, c
if (groupInfo != null) {
withContext(Dispatchers.Main) {
chatModel.chatsContext.updateGroup(rhId = rhId, groupInfo)
chatModel.chatsContext.chatItems.clearAndNotify()
chatModel.chatId.value = groupInfo.id
openGroupChat(rhId, groupInfo.groupId)
}
setGroupMembers(rhId, groupInfo, chatModel)
closeAll.invoke()