mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-29 07:38:54 +00:00
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:
+7
-8
@@ -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())
|
||||
}
|
||||
|
||||
+2
-2
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user